<?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>London SEO &#187; Apache</title>
	<atom:link href="http://london-seo.com/seo/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://london-seo.com</link>
	<description>London Search Engine Optimisation</description>
	<lastBuildDate>Thu, 03 Apr 2008 18:38:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Custom 404 error pages with .htaccess</title>
		<link>http://london-seo.com/custom-404-error-pages-with-htaccess/40/</link>
		<comments>http://london-seo.com/custom-404-error-pages-with-htaccess/40/#comments</comments>
		<pubDate>Mon, 09 Oct 2006 19:57:05 +0000</pubDate>
		<dc:creator>search engine optimiser</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Slightly Off Topic]]></category>

		<guid isPermaLink="false">http://london-seo.com/custom-404-error-pages-with-htaccess/40/</guid>
		<description><![CDATA[This is easy. Make a 404 error page, call it 404.php (or whatever) then in your .htaccess file enter: &#8221; ErrorDocument 404 /404.php&#8221; That is it!]]></description>
			<content:encoded><![CDATA[<p>This is easy. Make a 404 error page, call it 404.php (or whatever) then in your .htaccess file enter:</p>
<p>&#8221; ErrorDocument 404 /404.php&#8221;</p>
<p>That is it!</p>
]]></content:encoded>
			<wfw:commentRss>http://london-seo.com/custom-404-error-pages-with-htaccess/40/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A basic introduction to mod_rewrite.</title>
		<link>http://london-seo.com/a-basic-introduction-to-mod_rewrite/18/</link>
		<comments>http://london-seo.com/a-basic-introduction-to-mod_rewrite/18/#comments</comments>
		<pubDate>Mon, 04 Sep 2006 01:49:43 +0000</pubDate>
		<dc:creator>search engine optimiser</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SEO Basics 101]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://london-seo.com/a-basic-introduction-to-mod_rewrite/18/</guid>
		<description><![CDATA[A basic introduction to mod_rewrite. What is mod_rewrite? Mod_rewrite is a system for apache that lets you basically rewrite urls. It is quite advanced, while at the same time being quite simple. Why is it so important? It lets you change pages from something like viewnews.php?id=329579823948 to something like /viewnews/the-news-story-headline/. Of course, you will need [...]]]></description>
			<content:encoded><![CDATA[<p><strong>A basic introduction to mod_rewrite.</strong></p>
<p><strong> What is mod_rewrite?</strong><br />
Mod_rewrite is a system for <span class="hm" id="misp_compose_1">apache</span> that lets you basically rewrite <span class="hm" id="misp_compose_2">urls</span>. It is quite advanced, while at the same time being quite simple.</p>
<p><strong> Why is it so important?</strong><br />
It lets you change pages from something like <em><span class="hm" id="misp_compose_3">viewnews</span>.<span class="hm" id="misp_compose_4">php</span>?id=329579823948</em> to something like <em>/<span class="hm" id="misp_compose_5">viewnews</span>/the-news-story-headline/</em>. Of course, you will need to update your <span class="hm" id="misp_compose_6">actuall</span> links (from id=&#8230; to the new ones). But the reason it is so good is because firstly, who can remember 329579823948? And who can remember the-news-story-headline? Additionally, it is a lot better for <span class="hm" id="misp_compose_7">seo</span> to have keywords in the <span class="hm" id="misp_compose_8">url</span>, and most times your page title / etc will have the keywords in it.</p>
<p><strong><span class="hm" id="misp_compose_9">Ok</span>, walk me through a simple example using mod_rewrite</strong><br />
<span class="hm" id="misp_compose_10">Ok</span>. We are going to do a very simple mod_rewrite first, one that doesn&#8217;t involve any parameters (no id= or whatever).</p>
<p>For example, say at the moment our page is:<br />
<em> http://example.com/about_us.html</em></p>
<p>We want it to be<br />
<em> http://example.com/about/</em></p>
<p>Firstly you will need to be using <span class="hm" id="misp_compose_11">apache</span>. Make a file called <em>.<span class="hm" id="misp_compose_12">htaccess</span></em>, and put it in your public html folder (same folder as index.<span class="hm" id="misp_compose_13">php</span>/index.html etc etc. In my case with my host, it would be <em>/london-<span class="hm" id="misp_compose_14">seo</span>.com/.<span class="hm" id="misp_compose_15">htaccess</span>. </em>Often it is something like <em>public_html</em>). You may have a bit of trouble making it in Windows. If you do, name the file <em>&#8220;.<span class="hm" id="misp_compose_16">htaccess</span>&#8220;</em> (with the quotation marks).</p>
<p>Now you wanna put in <em>.<span class="hm" id="misp_compose_17">htaccess</span></em> the following (first two lines are not always needed, depending on your server configuration):</p>
<p><em> Options +Indexes<br />
Options +<span class="hm" id="misp_compose_18">FollowSymlinks</span><br />
<span class="hm" id="misp_compose_19">RewriteEngine</span> on<br />
<span class="hm" id="misp_compose_20">RewriteBase</span> /<br />
<span class="hm" id="misp_compose_21">RewriteRule</span> ^about/$ about_us.html [L]</em></p>
<p>See, its pretty easy. The <em>^</em> just means that represents the start of the string, and <em>$</em> represents the end of the string. It is just regular expression stuff&#8230; You don&#8217;t need to worry about it too much for the time being. Note how the domain itself doesn&#8217;t matter (nothing about example.com is in there)</p>
<p>Now lets do a more complicated example. We want to change:<br />
<em> http://example.com/news.<span class="hm" id="misp_compose_22">php</span>?<span class="hm" id="misp_compose_23">newsid</span>=48672</em></p>
<p>to:<br />
<em> http://example.com/news/48672/</em></p>
<p>Well we would then put in the following code:<br />
<em><br />
Options +Indexes<br />
Options +<span class="hm" id="misp_compose_24">FollowSymlinks</span><br />
<span class="hm" id="misp_compose_25">RewriteEngine</span> on<br />
<span class="hm" id="misp_compose_26">RewriteBase</span> /<br />
<span class="hm" id="misp_compose_27">RewriteRule</span> ^news/(.*)/$ news.<span class="hm" id="misp_compose_28">php</span>?<span class="hm" id="misp_compose_29">newsid</span>=$1 [L]<br />
</em><br />
The<em> $1</em> indicates that it should replace whatever was in the first occurrence of <em>(.*) </em>(note &#8211; there can be more than one <em>(.*)</em>.)</p>
<p>Well, that&#8217;s it for a basic mod_rewrite tutorial. Ideally you don&#8217;t wanna have id&#8217;s that relate just to a number, but you want some keywords. A good way to do this is to in your news.<span class="hm" id="misp_compose_33">php</span> only use the <span class="hm" id="misp_compose_34">newsid</span>=xx, but add in some extra, so you could have:</p>
<p><em> http://example.com/news/mod-rewrite-tutorial/89487/</em></p>
<p>The code for that would be:</p>
<p><em> Options +Indexes<br />
Options +<span class="hm" id="misp_compose_35">FollowSymlinks</span><br />
<span class="hm" id="misp_compose_36">RewriteEngine</span> on<br />
<span class="hm" id="misp_compose_37">RewriteBase</span> /<br />
<span class="hm" id="misp_compose_38">RewriteRule</span> ^news/(.*)/(.*)/$ news.<span class="hm" id="misp_compose_39">php</span>?<span class="hm" id="misp_compose_40">newsid</span>=$2 [L]</em></p>
<p>Notice how there is no &#8220;<em>$1</em>&#8220;. As you get more advanced you will get used to this kinda stuff. Again, this is only a basic tutorial, <span class="hm" id="misp_compose_41">there is</span> a lot more to it, but this will get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://london-seo.com/a-basic-introduction-to-mod_rewrite/18/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
