<?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>JJB Blog &#187; how-to-wordpress-mod_rewrite-permanent-redirect</title>
	<atom:link href="http://blog.johnjosephbachir.org/tag/how-to-wordpress-mod_rewrite-permanent-redirect/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johnjosephbachir.org</link>
	<description></description>
	<lastBuildDate>Wed, 04 Jan 2012 05:47:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Configuring mod_rewrite to provide permanent redirects after changing my WordPress permalink structure</title>
		<link>http://blog.johnjosephbachir.org/2006/10/16/configuring-mod_rewrite-to-provide-permanent-redirects-after-changing-my-wordpress-permalink-structure/</link>
		<comments>http://blog.johnjosephbachir.org/2006/10/16/configuring-mod_rewrite-to-provide-permanent-redirects-after-changing-my-wordpress-permalink-structure/#comments</comments>
		<pubDate>Mon, 16 Oct 2006 06:05:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[how-to-wordpress-mod_rewrite-permanent-redirect]]></category>

		<guid isPermaLink="false">http://blog.johnjosephbachir.org/2006/10/16/configuring-mod_rewrite-to-provide-permanent-redirects-after-changing-my-wordpress-permalink-structure/</guid>
		<description><![CDATA[In my quest for arbitrary and useless lexical elegance, a couple years ago I decided on a /%post_id% permalink structure for my blog. So all the URLs were of the structure http://blog.johnjosephbachir.org/330. Since then, Ben has convinced me that a /date/title structure is the way to go, as it provides orientation for the user in [...]]]></description>
			<content:encoded><![CDATA[<p>In my quest for arbitrary and useless lexical elegance, a couple years ago I decided on a /%post_id% permalink structure for my blog. So all the URLs were of the structure http://blog.johnjosephbachir.org/330. Since then, <a href="http://www.benhammersley.com/">Ben</a> has convinced me that a /date/title structure is the way to go, as it provides orientation for the user in terms of where the content came from. Also, it allows me to never worry about my permalink structure changing again, in terms of namespace etc.</p>
<p>Another benefit, <a href="http://blog.claimid.com/2006/05/tips-and-tricks-your-name-in-the-url/">as noted on the claimid blog a few months back</a>, is that search engines put value in the strings that are found in URLs. So there is a SEO benefit in having title slugs in urls.</p>
<p>I changed the permalink structure in the WordPress control panel, but to get permanent 301 redirects from the old URLs to the new, I needed to use Apache mod_rewrite. Here is what I came up with:</p>
<p><code><br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^([0-9]+)/?$ http://blog.johnjosephbachir.org/?p=$1 [R=301,L]<br />
&lt;/IfModule&gt;<br />
# below are the standard WordPress rewrite rules<br />
# BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;</p>
<p># END WordPress<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.johnjosephbachir.org/2006/10/16/configuring-mod_rewrite-to-provide-permanent-redirects-after-changing-my-wordpress-permalink-structure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

