<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PHP 301 Redirect: Moved Permanently</title>
	<atom:link href="http://websitedesign.websitesinaflash.com/2007/02/php-301-redirect-moved-permanently/feed/" rel="self" type="application/rss+xml" />
	<link>http://websitedesign.websitesinaflash.com/2007/02/php-301-redirect-moved-permanently/</link>
	<description>Website Design, PHP, CSS and Humor</description>
	<lastBuildDate>Mon, 06 Feb 2012 22:15:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: pseudorad10</title>
		<link>http://websitedesign.websitesinaflash.com/2007/02/php-301-redirect-moved-permanently/comment-page-1/#comment-16</link>
		<dc:creator>pseudorad10</dc:creator>
		<pubDate>Thu, 20 Sep 2007 19:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://webmaster.websitesinaflash.com/?p=5#comment-16</guid>
		<description>Using .htaccess to redirect:&lt;br/&gt;&lt;br/&gt;This is the rough equivalent to your php script using a couple of lines in your .htaccess file. These lines use the Apache webserver&#039;s mod_rewrite engine.&lt;br/&gt;&lt;br/&gt;# Add .www if missing&lt;br/&gt;RewriteCond   %{HTTP_HOST} !^www\. [NC]&lt;br/&gt;RewriteRule   ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]&lt;br/&gt;&lt;br/&gt;This file should be placed in your web site&#039;s root directory or these lines can be added to one that already pre-exists.&lt;br/&gt;&lt;br/&gt;Note: This will not work correctly with subdomains without a bit more time and effort.&lt;br/&gt;&lt;br/&gt;Using Apache&#039;s mod_rewrite has the added benefit of redirecting before php attempts to parse any page. Also, it saves having to add or include this extra script to every page on your site. Finally, the last benefit would be that it works for any type of document you are serving (ie: *.html) not just php documents.</description>
		<content:encoded><![CDATA[<p>Using .htaccess to redirect:</p>
<p>This is the rough equivalent to your php script using a couple of lines in your .htaccess file. These lines use the Apache webserver&#8217;s mod_rewrite engine.</p>
<p># Add .www if missing<br />RewriteCond   %{HTTP_HOST} !^www\. [NC]<br />RewriteRule   ^(.*)$ <a href="http://www.%" rel="nofollow">http://www.%</a>{HTTP_HOST}/$1 [R=301,L]</p>
<p>This file should be placed in your web site&#8217;s root directory or these lines can be added to one that already pre-exists.</p>
<p>Note: This will not work correctly with subdomains without a bit more time and effort.</p>
<p>Using Apache&#8217;s mod_rewrite has the added benefit of redirecting before php attempts to parse any page. Also, it saves having to add or include this extra script to every page on your site. Finally, the last benefit would be that it works for any type of document you are serving (ie: *.html) not just php documents.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

