<?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>Web's Best Blog &#187; RedirectMatch</title>
	<atom:link href="http://www.webs-best-directory.com/blog/tag/redirectmatch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webs-best-directory.com/blog</link>
	<description>Internet Marketing, SEM, News, Sports, Videos, and Politics Blog</description>
	<lastBuildDate>Thu, 11 Jun 2009 22:47:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Redirecting All Traffic From A Subdirectory To The Root</title>
		<link>http://www.webs-best-directory.com/blog/2008/12/22/redirecting-all-traffic-from-a-subdirectory-to-the-root/</link>
		<comments>http://www.webs-best-directory.com/blog/2008/12/22/redirecting-all-traffic-from-a-subdirectory-to-the-root/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 21:16:41 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
				<category><![CDATA[SEM]]></category>
		<category><![CDATA[Redirection]]></category>
		<category><![CDATA[RedirectMatch]]></category>

		<guid isPermaLink="false">http://www.webs-best-directory.com/blog/?p=316</guid>
		<description><![CDATA[If you want to permanently redirect all the traffic from a subdirectory to the root domain, and you&#8217;re running Apache, the job is quite simple.  All you need to do is make sure you mod_alias installed, and then you can a simple command to your .htaccess file.  
Here&#8217;s example code.

RedirectMatch 301 ^/old/(.*)/$ http://www.newdomain.com/$1/

That [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to permanently redirect all the traffic from a subdirectory to the root domain, and you&#8217;re running Apache, the job is quite simple.  All you need to do is make sure you mod_alias installed, and then you can a simple command to your .htaccess file.  </p>
<p>Here&#8217;s example code.</p>
<p><code><br />
RedirectMatch 301 ^/old/(.*)/$ http://www.newdomain.com/$1/<br />
</code></p>
<p>That would take all the requests for files located in the /old/ directory and redirect them permanently their new location at the root.  This might come in handy for someone who has a blog installed in a subdirectory and wants to promote it to the root.</p>
<p>You can also exclude directories, in case you need to.  Use the following syntax:</p>
<p><code><br />
Redirect permanent ^/(?!category/)(?!tag/)(.*)/(.*)/$<br />
</code></p>
<p>Redirect match supports regex so anything that can be done in regex can be done using redirectmatch.  The <a href="http://httpd.apache.org/docs/1.3/mod/mod_alias.html#redirectmatch">documentation</a> from Apache is typically obtuse.</p>
<p>&#8220;This directive is equivalent to Redirect, but makes use of standard regular expressions, instead of simple prefix matching. The supplied regular expression is matched against the URL-path, and if it matches, the server will substitute any parenthesized matches into the given string and use it as a filename.&#8221;</p>
<p>In any event, redirectmatch is an extremely powerful and easy to use way to do redirection.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webs-best-directory.com/blog/2008/12/22/redirecting-all-traffic-from-a-subdirectory-to-the-root/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
