<?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>Smoothape - Mutterings and Oddities &#187; 301</title>
	<atom:link href="http://blog.smoothape.com/tag/301/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smoothape.com</link>
	<description>just ignore me</description>
	<lastBuildDate>Sun, 22 Aug 2010 13:44:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>.htaccess</title>
		<link>http://blog.smoothape.com/2009/08/10/htaccess/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=htaccess</link>
		<comments>http://blog.smoothape.com/2009/08/10/htaccess/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 03:23:34 +0000</pubDate>
		<dc:creator>Smoothape</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pearl]]></category>
		<category><![CDATA[redirects]]></category>

		<guid isPermaLink="false">http://blog.smoothape.com/?p=125</guid>
		<description><![CDATA[301 Redirect 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it shouldpreserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.smoothape.com%2F2009%2F08%2F10%2Fhtaccess%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.smoothape.com%2F2009%2F08%2F10%2Fhtaccess%2F&amp;source=Smoothape&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>301 Redirect</strong></p>
<p>301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it shouldpreserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved permanently”.</p>
<p>Below are a Couple of methods to implement URL Redirection</p>
<p><strong>ASP Redirect</strong></p>
<p>&lt; %@ Language=VBScript %&gt;<br />
&lt; %<br />
Response.Status=&#8221;301 Moved Permanently&#8221;<br />
Response.AddHeader &#8220;Location&#8221;,&#8221;http://www.new-url.com/&#8221;<br />
%&gt;</p>
<p><strong>CGI PERL Redirect</strong></p>
<p>$q = new CGI;<br />
print $q-&gt;redirect(”http://www.new-url.com/”);</p>
<p><strong>ColdFusion Redirect</strong></p>
<p>&lt; .cfheader statuscode=&#8221;301&#8243; statustext=&#8221;Moved permanently&#8221;&gt;<br />
&lt; .cfheader name=&#8221;Location&#8221; value=&#8221;http://www.new-url.com&#8221;&gt;</p>
<p><strong>IIS Redirect</strong></p>
<p>In internet services manager, right click on the file or folder you wish to redirectSelect the radio titled “a redirection to a URL”.Enter the redirection pageCheck “The exact url entered above” and the “A permanent redirection for this resource”Click on ‘Apply’</p>
<p><strong>JSP (Java) Redirect</strong></p>
<p>&lt; %<br />
response.setStatus(301);<br />
response.setHeader( &#8220;Location&#8221;, &#8220;http://www.new-url.com/&#8221; );response.setHeader( &#8220;Connection&#8221;, &#8220;close&#8221; );<br />
%&gt;</p>
<p><strong>PHP Redirect</strong></p>
<p>&lt; ?<br />
Header( &#8220;HTTP/1.1 301 Moved Permanently&#8221; );Header( &#8220;Location: http://www.new-url.com&#8221; );<br />
?&gt;</p>
<p><strong>Ruby on Rails Redirect</strong></p>
<p>def old_action<br />
headers["Status"] = “301 Moved Permanently”<br />
redirect_to “http://www.new-url.com/”<br />
end</p>
<p><strong>Redirect Old domain to New domain (htaccess redirect)</strong></p>
<p>Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected toyour new domain.</p>
<p>The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)</p>
<p>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]</p>
<p>Please REPLACE www.newdomain.com in the above code with your actual domain name.</p>
<p>In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.</p>
<p>Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.</p>
<p><strong>Redirect to www (htaccess redirect)</p>
<p><span style="font-weight: normal;">Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.comThe .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed) </span></strong></p>
<p><strong><span style="font-weight: normal;">Options +FollowSymlinks<br />
RewriteEngine on<br />
rewritecond %{http_host} ^domain.com [nc]<br />
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]</p>
<p>Please REPLACE domain.com and www.newdomain.com with your actual domain name.</span></strong></p>
<p><strong><span style="font-weight: normal;">Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.</p>
<p><strong>How to Redirect HTML </strong></span></strong></p>
<p>Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted ona Windows Server.
<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.smoothape.com%2F2009%2F08%2F10%2Fhtaccess%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.smoothape.com%2F2009%2F08%2F10%2Fhtaccess%2F&amp;source=Smoothape&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://blog.smoothape.com/2009/08/10/htaccess/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess&amp;desc=301%20Redirect%0D%0A%0D%0A301%20redirect%20is%20the%20most%20efficient%20and%20Search%20Engine%20Friendly%20method%20for%20webpage%20redirection.%20It%E2%80%99s%20not%20that%20hard%20to%20implement%20and%20it%20shouldpreserve%20your%20search%20engine%20rankings%20for%20that%20particular%20page.%20If%20you%20have%20to%20change%20file%20names%20or%20move%20pages%20around%2C%20it%E2%80%99s%20the%20safest%20option." rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.smoothape.com/2009/08/10/htaccess/&amp;t=.htaccess" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;bm_description=.htaccess&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.smoothape.com/2009/08/10/htaccess/&amp;title=.htaccess" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://blog.smoothape.com/2009/08/10/htaccess/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=.htaccess+-+http://e7t.us/7bf22f&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.smoothape.com/2009/08/10/htaccess/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
