{"id":242,"date":"2008-08-30T15:57:08","date_gmt":"2008-08-30T19:57:08","guid":{"rendered":"http:\/\/www.eyoungwon.com\/journal\/?p=242"},"modified":"2008-08-30T16:44:19","modified_gmt":"2008-08-30T20:44:19","slug":"301-redirects-white-hat-seo","status":"publish","type":"post","link":"https:\/\/eyoungwon.com\/journal\/301-redirects-white-hat-seo\/","title":{"rendered":"301 Redirects &#8211; White Hat SEO"},"content":{"rendered":"<p><a href=\"http:\/\/www.seobook.com\/1342-0-1-3.html\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/www.seobook.com\/rf\/banners\/468-60.gif\" width=\"468\" height=\"60\"\/><\/a><br \/>\n<strong>301 Redirects &#8211; White Hat SEO<\/strong><\/p>\n<p>301 redirect is the most efficient and <strong>Search Engine Friendly<\/strong> method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code &#8220;301&#8221; is interpreted as &#8220;moved permanently&#8221;.<\/p>\n<p class=\"defaultfont\" align=\"justify\"> Below are a Couple of methods to implement <strong>URL Redirection<\/strong><\/p>\n<h2>IIS Redirect<\/h2>\n<ul class=\"defaultfont\">\n<li>In internet services manager, right click on the file or folder you wish to redirect<\/li>\n<li>Select the radio titled &#8220;a redirection to a URL&#8221;.<\/li>\n<li>Enter the redirection page<\/li>\n<li>Check &#8220;The exact url entered above&#8221; and the &#8220;A permanent redirection for this resource&#8221;<\/li>\n<li>Click on &#8216;Apply&#8217;<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>ColdFusion Redirect<\/h2>\n<p><font class=\"defaultfont\"> &lt;.cfheader statuscode=&#8221;301&#8243; statustext=&#8221;Moved permanently&#8221;&gt;<br \/>\n&lt;.cfheader name=&#8221;Location&#8221; value=&#8221;http:\/\/www.new-url.com&#8221;&gt; <\/font><\/p>\n<h2>PHP Redirect<\/h2>\n<p><font class=\"defaultfont\">&lt;?<br \/>\nHeader( &#8220;HTTP\/1.1 301 Moved Permanently&#8221; );<br \/>\nHeader( &#8220;Location: http:\/\/www.new-url.com&#8221; );<br \/>\n?&gt; <\/font><\/p>\n<h2>ASP Redirect<\/h2>\n<p><font class=\"defaultfont\"> &lt;%@ Language=VBScript %&gt;<br \/>\n&lt;%<br \/>\nResponse.Status=&#8221;301 Moved Permanently&#8221;<br \/>\nResponse.AddHeader &#8220;Location&#8221;,&#8221;http:\/\/www.new-url.com\/&#8221;<br \/>\n%&gt; <\/font><\/p>\n<h2>ASP .NET Redirect<\/h2>\n<p><font class=\"defaultfont\"> &lt;script runat=&#8221;server&#8221;&gt;<br \/>\nprivate void Page_Load(object sender, System.EventArgs e)<br \/>\n{<br \/>\nResponse.Status = &#8220;301 Moved Permanently&#8221;;<br \/>\nResponse.AddHeader(&#8220;Location&#8221;,&#8221;http:\/\/www.new-url.com&#8221;);<br \/>\n}<br \/>\n&lt;\/script&gt;  <\/font><\/p>\n<h2>JSP (Java) Redirect<\/h2>\n<p><font class=\"defaultfont\"> &lt;%<br \/>\nresponse.setStatus(301);<br \/>\nresponse.setHeader( &#8220;Location&#8221;, &#8220;http:\/\/www.new-url.com\/&#8221; );<br \/>\nresponse.setHeader( &#8220;Connection&#8221;, &#8220;close&#8221; );<br \/>\n%&gt; <\/font><\/p>\n<h2>CGI PERL Redirect<\/h2>\n<p><font class=\"defaultfont\"> $q = new CGI;<br \/>\nprint $q-&gt;redirect(&#8220;http:\/\/www.new-url.com\/&#8221;); <\/font><\/p>\n<h2>Ruby on Rails Redirect<\/h2>\n<p><font class=\"defaultfont\"> def old_action<br \/>\nheaders[&#8220;Status&#8221;] = &#8220;301 Moved Permanently&#8221;<br \/>\nredirect_to &#8220;http:\/\/www.new-url.com\/&#8221;<br \/>\nend <\/font><\/p>\n<h2>Redirect Old domain to New domain (htaccess redirect)<\/h2>\n<p class=\"defaultfont\" align=\"justify\"> 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 to your new domain.<br \/>\nThe .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>\n<p class=\"defaultfont\" align=\"justify\"> Options +FollowSymLinks<br \/>\nRewriteEngine on<br \/>\nRewriteRule (.*) http:\/\/www.newdomain.com\/$1 [R=301,L]\n<\/p>\n<p class=\"defaultfont\" align=\"justify\"> Please REPLACE www.newdomain.com in the above code with your actual domain name.<\/p>\n<p class=\"defaultfont\" align=\"justify\">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>\n<p class=\"defaultfont\" align=\"justify\"> <strong>Note*<\/strong> This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.<\/p>\n<h2>Redirect to www (htaccess redirect)<\/h2>\n<p class=\"defaultfont\" align=\"justify\">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.com<br \/>\nThe .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>\n<p class=\"defaultfont\" align=\"justify\"> Options +FollowSymlinks<br \/>\nRewriteEngine on<br \/>\nrewritecond %{http_host} ^domain.com [nc]<br \/>\nrewriterule ^(.*)$ http:\/\/www.domain.com\/$1 [r=301,nc]\n<\/p>\n<p class=\"defaultfont\" align=\"justify\"> Please REPLACE domain.com and www.newdomain.com with your actual domain name.<\/p>\n<p class=\"defaultfont\" align=\"justify\"> <strong>Note*<\/strong> This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.<\/p>\n<p><a href=\"http:\/\/www.seobook.com\/1342-0-1-3.html\" target=\"_blank\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/www.seobook.com\/rf\/banners\/468-60.gif\" width=\"468\" height=\"60\"\/><\/a><\/p>\n<h2>How to Redirect HTML<\/h2>\n<p class=\"defaultfont\" align=\"justify\">Please refer to section titled &#8216;How to Redirect with htaccess&#8217;, if your site is hosted on a Linux Server and &#8216;IIS Redirect&#8217;, if your site is hosted on a Windows Server.<\/p>\n<p class=\"defaultfont\" align=\"justify\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>301 Redirects &#8211; White Hat SEO 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,19,2,39],"tags":[],"class_list":["post-242","post","type-post","status-publish","format-standard","hentry","category-sem","category-seo","category-web-development","category-web-hosting"],"_links":{"self":[{"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/comments?post=242"}],"version-history":[{"count":0,"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/posts\/242\/revisions"}],"wp:attachment":[{"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/media?parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/categories?post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eyoungwon.com\/journal\/wp-json\/wp\/v2\/tags?post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}