<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>opensourcetutor.com &#187; Web Development</title>
	<atom:link href="http://www.opensourcetutor.com/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.opensourcetutor.com</link>
	<description>On Linux, Web Development, Joomla and Magento commerce</description>
	<lastBuildDate>Sat, 04 Feb 2012 10:27:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using mod_rewrite for moving websites, folder and domain names for SEO retention</title>
		<link>http://www.opensourcetutor.com/2009/12/04/using-mod_rewrite-for-moving-websites-folder-and-domain-names-for-seo-retention/</link>
		<comments>http://www.opensourcetutor.com/2009/12/04/using-mod_rewrite-for-moving-websites-folder-and-domain-names-for-seo-retention/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 05:34:22 +0000</pubDate>
		<dc:creator>salubrium</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://www.opensourcetutor.com/2009/12/04/using-mod_rewrite-for-moving-websites-folder-and-domain-names-for-seo-retention/</guid>
		<description><![CDATA[



mod_rewrite is a powerful Apache module that gives you the power over the URL&#8217;s displayed to your visitors to your site. 
Much has been written already by many people using both examples and tutorials of the basics. The aim of my addition, as always is primarily for my own notes and secondarily to explain why you want to use mod_rewrite for SEO ranking retention.
Let&#8217;s say you have a website that enjoys well ranked pages and a lot of traffic via google or has a great deal of Backlinks from other ...]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-9469051832075629";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-05-22: opensourcetutor.com
google_ad_channel = "3549963802";
google_color_border = "FFF";
google_color_bg = "FFF";
google_color_link = "333";
google_color_text = "CCCCCC";
google_color_url = "999999";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
mod_rewrite is a powerful Apache module that gives you the power over the URL&#8217;s displayed to your visitors to your site. </p>
<p>Much has been written already by many people using both examples and tutorials of the basics. The aim of my addition, as always is primarily for my own notes and secondarily to explain why you want to use mod_rewrite for SEO ranking retention.</p>
<p>Let&#8217;s say you have a website that enjoys well ranked pages and a lot of traffic via google or has a great deal of Backlinks from other blogs or websites to particular pages in your site. One of the powerful aspects of <a target="_blank" href="https://www.google.com/webmasters/tools/">Google Webmaster Tools</a> is that it easily provides you a way to be able to view which URL&#8217;s are linking particular pages on your own website. When contemplating moving a website or rearranging the structure of an existing website, one of your first considerations should be to maintain the availability of accessing your new pages via your old links. Essentially we map your current (old) structure to your new (proposed) structure. </p>
<p>Here&#8217;s our first sample. The old url was http://www.domain.com.au/mstore/2wsub1 and our new URL includes keyword rich content: http://www.domain.com.au/htc-hero-android-brown. We use the following mapping:<br />
<code></code>
<pre>
     RewriteRule ^mstore/2wsub1(.*)$ http://www.domain.com.au/htc-hero-android-brown   [R=301,NC,L]
</pre>
<p><b>The above means:</b> Any content being requested at <i>/mstore/2wsub1</i> or <i>/mstore/2wsub1.html</i> or<i> /mstore/2wsub1.asp</i> etc. will be redirected to <i>http://www.domain.com.au/htc-hero-android-brown</i>. The redirect additionally offers the following further information about the redirect.[R=301,NC,L] tells the requester that it is a permanent redirect (R=301 &#8211; Permanent Redirect) and that the requested URL match is case-insensitive (NC &#8211; no-case) and that if it finds a match, then redirect and do not attempt any further matches [L - Last match]
<p>After migrating a website, I advise to monitor both Google Webmaster Tools and also your server site statistics / logs for 404 Errors, so you can correct any URL&#8217;s you hadn&#8217;t originally mapped.
</p>
<h2>Migrating domain names &amp; ensuring a single accessible URL</h2>
<p>In this scenario, we are moving <i>http://www.olddomain.com.au/</i> to <i>http://www.coolnewdomain.com.au/</i> because your audience are Mac users and like anything with the title &#8220;cool&#8221; in it ;). As an aside, we want to ensure that people are always directed to <i>http://www.coolnewdomain.com.au</i> if they type in <i>http://coolnewdomain.com.au</i> and search engines only index the www version so that you do not have duplicate content listed.<br />
<code></code>
<pre>
        RewriteCond %{HTTP_HOST} !^www\.coolnewdomain\.com\.au$
        RewriteRule (.*)       http://www.coolnewdomain.com.au/$1 [R=301,NC]
</pre>
<p><b>The above means:</b> If you have NOT accessed the website using <i>http://www.coolnewdomain.org.au</i> then redirect you to <i>http://www.coolnewdomain.org.au</i> . The $1 value is the &#8216;first variable&#8217;. What it means is that if you access: <i>http://olddomain.com.au/cool-product</i> will be redirected to <i>http://www.coolnewdomain.com.au/cool-new-product</i>. Everything after the domain name is used as a variable to attach to the end of the new domain name. Even if you have not migrated domain names it is still wise to use this code on your existing site so that search engines only search one &#8216;form&#8217; of your domain name. One last thing to note here, is that we don&#8217;t use the [L] flag, allowing mod_rewrite to continue looking for matches, as there&#8217;s still a chance it could find a match for url&#8217;s like our first example.</p>
<h2>Using mod_rewrite for blocking access to a website as an alternative to Basic Authentication</h2>
<p>Real life usage scenario. Some developers I know created a development website similar to <i>http://dev.coolnewsite.com.au/</i> that was accessible publicly without authentication. They assumed as they hadn&#8217;t advertised it, nobody knew about it but just prior to going live, google &#8216;found&#8217; the site and indexed it. When the real site went live, anytime they were searching in google for the site or for products, the <i>http://dev.coolnewsite.com.au/ </i>was being displayed. They wanted to block access to the dev site but they didn&#8217;t want to lose the fact that they already had some visitors and page rank on the dev site. I tried to use a mod_rewrite rule as above before the Authentication rule but the auth rule takes effect before the rewrite rule,so visitors were being asked to authenticate and not being redirected, additionally this wouldn&#8217;t have told google about the new, actual live site. So here&#8217;s what I did:<br />
<code></code>
<pre>
 RewriteCond %{REMOTE_ADDR} !^213\.206\.175\.212$
 RewriteCond %{REMOTE_ADDR} !^124\.231\.17\.180$
 RewriteCond %{REMOTE_ADDR} !^123\.168\.239\.32$
 RewriteRule ^(.*)$ http://www.coolnewdomain.com.au/$1 [R=301,L]
</pre>
<p>ps: fictitous IP addresses provided ;)<b><br />
The above means:</b> If your IP address is NOT 213.206.175.212 (dev A) or 124.231.17.180 (dev B) or 123.168.239.32 (Customer) then redirect the visitor to http://www.coolnewdomain.com.au/ with a permanent redirect [R=301] and make it the last matching rule [L].</p>
<p>This means search engines will know about the real, live site next time they come to visit, anyone searching for the site finding the dev site will be redirected to the equivalent URL on the live site but the developers and customer can still access the dev site from the three different locations. The obvious downside to the above code is that if you are not using a static IP address, you will need to update the addresses each time your IP changes. We will add authentication as our live site begins to take rankings above the dev site.</p>
<p>Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/mod_rewrite" rel="tag">mod_rewrite</a>, <a class="performancingtags" href="http://technorati.com/tag/apache" rel="tag">apache</a>, <a class="performancingtags" href="http://technorati.com/tag/lamp" rel="tag">lamp</a>, <a class="performancingtags" href="http://technorati.com/tag/web development" rel="tag">web development</a></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=4057f26c-38f8-8c07-993b-e54351a24005" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.opensourcetutor.com/2009/12/04/using-mod_rewrite-for-moving-websites-folder-and-domain-names-for-seo-retention/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pluf &#8211; A PHP5 Port of Django</title>
		<link>http://www.opensourcetutor.com/2009/06/10/pluf-a-php5-port-of-django/</link>
		<comments>http://www.opensourcetutor.com/2009/06/10/pluf-a-php5-port-of-django/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 00:28:15 +0000</pubDate>
		<dc:creator>salubrium</dc:creator>
				<category><![CDATA[Linux Administration]]></category>
		<category><![CDATA[Virtualization (Virtualisation)]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pluf]]></category>

		<guid isPermaLink="false">http://www.opensourcetutor.com/2009/06/10/pluf-a-php5-port-of-django/</guid>
		<description><![CDATA[Pluf is a PHP Framework developed as a port of Django to PHP. It claims to be simple, elegant and easy for people used to Django but in PHP5 so easy to deploy all over the world.
After reading the documentation, the file layout and concepts are all quite similar to django, though a downside is that we lose much of the beauty of the Python language and it doesn&#8217;t seem to have the Admin interface that makes django so delightful to work with.
Here is a sample of a helloworld, which ...]]></description>
			<content:encoded><![CDATA[<p>Pluf is a PHP Framework developed as a port of Django to PHP. It claims to be <i>simple, elegant and easy for people used to Django but in PHP5 so easy to deploy all over the world.</i></p>
<p>After reading the documentation, the file layout and concepts are all quite similar to django, though a downside is that we lose much of the beauty of the Python language and it doesn&#8217;t seem to have the Admin interface that makes django so delightful to work with.</p>
<p>Here is a sample of a helloworld, which would exist in a file called &#8220;Hello/Views.php&#8221;</p>
<pre>
<code>&lt; ?php
class Hello_Views
{
    public function hello($request, $match)
    {
        return new Pluf_HTTP_Response('Hello World!');
    }
}</code>
</code></pre>
<p>as you can see, it is reasonably similar to (though more verbose than) Django&#8217;s equivalent &#8220;/hello/views.py&#8221; which would look like this:</p>
<pre><code>from django.http import HttpResponse
def index(request):
    return HttpResponse("Hello world")</code></pre>
<p>Check out the full <a href="http://www.pluf.org/doc/hello-world.html" target="_blank">helloworld tutorial</a> of <a href="http://www.pluf.org/" target="_blank">Pluf</a></p>
<h2>ORM</h2>
<p>Pluf has an ORM that applies similar concepts and ideas as Django&#8217;s ORM, though as with the helloworld, it is slightly more verbose. The rest of the framework follows the same patterns, urls.php has a more verbose PHP regex patterns than django&#8217;s urls.py</p>
<h2>Caching</h2>
<p>Pluf runs it&#8217;s own caching system as well as being able to utilise <a href="http://php.net/apc" target="_blank">APC</a> and <a href="http://www.danga.com/memcached/" target="_blank">Memcached</a></p>
<h2>Django vs Pluf</h2>
<p>So what exactly does Pluf offer in ways of advantages over Django and why would you choose to use it instead? The obvious reasons are if you are well setup as a PHP developer. You work with tools and ide&#8217;s setup specifically for PHP, you have hosting infrastructure setup for PHP and you work with developers who are well versed in PHP. The other advantage of Pluf is that it comes with a migration framework out of the box, whereas django doesn&#8217;t and you need to use one of the available <a href="http://code.djangoproject.com/wiki/SchemaEvolution" target="_blank">database schema migration</a>, the most promising currently looks like <a href="http://south.aeracode.org/" target="_blank">South</a></p>
<p>Of course, Django deployment is becoming much simpler recently by leveraging the tutorials and tools like <a href="http://pypi.python.org/pypi/virtualenv" target="_blank">virtualenv</a>, <a href="http://pypi.python.org/pypi/pip" target="_blank">pip</a> and most recently <a href="http://www.modrails.com/" target="_blank">modrails</a> has begun supporting python wsgi services. I recently performed some benchmarks with modrails vs fastcgi against a django blogging application called <a href="http://byteflow.su/" target="_blank">byteflow</a> and modrails provided approx 1.8x speedup. More to come on that later.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-9469051832075629";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-05-22: opensourcetutor.com
google_ad_channel = "3549963802";
google_color_border = "FFF";
google_color_bg = "FFF";
google_color_link = "333";
google_color_text = "CCCCCC";
google_color_url = "999999";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a class="performancingtags" href="http://technorati.com/tag/Pluf" rel="tag">Pluf</a>, <a class="performancingtags" href="http://technorati.com/tag/Django" rel="tag">Django</a>, <a class="performancingtags" href="http://technorati.com/tag/Web Development" rel="tag">Web Development</a>, <a class="performancingtags" href="http://technorati.com/tag/Framework" rel="tag">Framework</a>, <a class="performancingtags" href="http://technorati.com/tag/MVC" rel="tag">MVC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.opensourcetutor.com/2009/06/10/pluf-a-php5-port-of-django/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

