<?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>Lee&#039;s Thoughts &#187; wordpress</title>
	<atom:link href="http://blog.lemworld.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lemworld.com</link>
	<description>A Look Inside the Thoughts of Lee Emmert</description>
	<lastBuildDate>Fri, 14 May 2010 21:01:23 +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>Moving Your WordPress Blog to a New Domain Name or URL</title>
		<link>http://blog.lemworld.com/2010/moving-your-wordpress-blog-to-a-new-domain-name-or-url/</link>
		<comments>http://blog.lemworld.com/2010/moving-your-wordpress-blog-to-a-new-domain-name-or-url/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 16:57:41 +0000</pubDate>
		<dc:creator>lem</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.lemworld.com/?p=586</guid>
		<description><![CDATA[In the past several months I have taken a more active interest in my web presence, namely my websites&#8217; placement in search results for queries of my name. My personal website and blog were previously hosted under two different domain names, and I decided to consolidate the URLs of my personal blog and personal website [...]<!-- Easy AdSense V2.89 -->
<!-- Post[count: 3] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8596666976171363";
google_ad_slot = "2906385676";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.89 -->

]]></description>
			<content:encoded><![CDATA[<p>In the past several months I have taken a more active interest in my web presence, namely my websites&#8217; placement in search results for queries of my name.  My personal website and blog were previously hosted under two different domain names, and I decided to consolidate the URLs of my personal blog and personal website under one domain name.  I wanted to reclaim the previous domain name for another use, and I wanted to accomplish all of this without breaking any existing inbound links to my WordPress blog posts.</p>
<p>With some creative thinking and using <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">mod_rewrite</a>, it is possible to move your blog to a new location, ensure your visitors never miss a beat, and reuse your old domain name.  Here is the approach I used to move WordPress to a new domain name without breaking any existing links.  For the purposes of this discussion, we will use URL1 and URL2 to stand in for our source and target URLs, respectively.  I also assume you are using <a href="http://httpd.apache.org/docs/">Apache</a> and that your server/host supports mod_rewrite.</p>
<p>1. The first step is to identify the target domain name, URL2.  My hosting company <a href="http://www.dreamhost.com/r.cgi?229554">DreamHost</a> has a web-based control panel that makes this part easy, and in my case, I chose to create a new <a href="http://wiki.dreamhost.com/Subdomain">subdomain</a> of my personal website.</p>
<p>2. WordPress provides excellent documentation for how to <a href="http://codex.wordpress.org/Moving_WordPress">move the blog</a> itself.  Just be careful not to <strong>change</strong> your permalink structure in the process.</p>
<p>3. You can manipulate the .htaccess file at URL1 to automatically redirect your traffic to URL2.  If you have no intentions of reusing this domain, the following code in your URL1 htaccess file will simply redirect all traffic to URL2, preserving the path of the original request:</p>
<p><code><br />
Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule (.*) http://URL2/$1 [R=301,L]<br />
</code></p>
<p>However, if you are like me and you want to reuse URL1 for something else, you can do a bit of pattern matching on the requested paths to redirect only WordPress-specific pages to your new domain.  I simply browsed through my own blog and noted that only a handful of paths need to be redirected.  Then I created a <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule">RewriteRule</a> for each.</p>
<p><code><br />
RewriteEngine on<br />
RewriteCond %{REQUEST_URI} ^/$</p>
<p># If you do not want to redirect your blog's homepage to your new domain name, comment out the next line<br />
RewriteRule ^(.*)$ http://URL2/ [L,R=301]</p>
<p># Redirect the permalink structure to URL2<br />
# (assuming permalink struct: http://URL1/year/...)<br />
RewriteRule ^2009(.*) http://URL2/2009$1 [L,R=301]<br />
RewriteRule ^2008(.*) http://URL2/2008$1 [L,R=301]<br />
RewriteRule ^2007(.*) http://URL2/2007$1 [L,R=301]<br />
RewriteRule ^2006(.*) http://URL2/2006$1 [L,R=301]<br />
RewriteRule ^2005(.*) http://URL2/2005$1 [L,R=301]<br />
RewriteRule ^2004(.*) http://URL2/2004$1 [L,R=301]<br />
RewriteRule ^2003(.*) http://URL2/2003$1 [L,R=301]<br />
RewriteRule ^2002(.*) http://URL2/2002$1 [L,R=301]<br />
RewriteRule ^2001(.*) http://URL2/2001$1 [L,R=301]</p>
<p># Redirect these standard locations<br />
RewriteRule ^category(.*) http://URL2/category$1 [L,R=301]<br />
RewriteRule ^author(.*) http://URL2/author$1 [L,R=301]<br />
RewriteRule ^wp-content(.*) http://URL2/wp-content$1 [L,R=301]<br />
RewriteRule ^wp-admin(.*) http://URL2/wp-admin$1 [L,R=301]<br />
RewriteRule ^feed(.*) http://URL2/feed$1 [L,R=301]</p>
<p># Finally, redirect any Pages you may have<br />
RewriteRule ^about(.*) http://URL2/about$1 [L,R=301]<br />
</code></p>
<p>The only catch here is that if you want to reuse URL1, you cannot duplicate any of the paths that you are redirecting because your visitors will never see that content.  If you use a different permalink structure, simply adjust the regular expressions in each RewriteRule to match.</p>
<p>Hopefully this helps with your next WordPress move.  With the magic of mod_rewrite and some creative htaccess entries, your visitors will arrive at your blog&#8217;s new location without incident and never the wiser.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lemworld.com/2010/moving-your-wordpress-blog-to-a-new-domain-name-or-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.222 seconds -->

