SEO FAQ

What is the best way to redirect a site?

Trust level: Proven and confirmed

The best method is the so called 301 redirect as in this way you also tell the search engines that the page in question has been moved permanently (302 is temporary and is very risky for SEO purposes).

Here are the ways to do it:

Examples using .htaccess

Redirect 301 /oldfolder http://www.toanewdomain.com
Redirect 301 /oldurl.html http://www.yourdomain.com/newurl.html


If your server has windows then use it this way on the file that is being moved:

For windows server

<%@ Language=VBScript %>

<%

Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.dindomän.se/och-kanske/nya-dokumentet.html"

%>


You can also use PHP or ASP for this and then just add these lines at the top of the file:

PHP

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newdir/newpage.htm");
exit();


ASP 301

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.newdomain.com/newdir/newpage.asp"
response.end
%>


Redirect using meta refresh or javascript is not recommended and may even be harmful as this method has been used a lot by spammers and is most likely making the search engines penalising your site.
 
Answer provided by:

Jim Westergren

SEO FAQ

  Submit an answer or add information
to the question: What is the best way to redirect a site?


Only the top high quality submissions are approved. If you don't know SEO it is not needed that you waste your time here.

Trust level:
It is important that you select the correct one.
Answer:
Thousands of people will read what you write here and you represent it with your name.
Only unique content, no cut and paste (I will check with Google - don't want this site be hitten by the duplicate content filter).
Don't write something that was already answered to this question earlier but you may add information to earlier answers.
Any promotion for any company/person etc. will be edited out.
HTML can be used but sparingly. Use <em> instead of <strong> to emphasize words. But feel free to use headings, lists and vital neutral links.
Name:
Personal name, company name or forum nick name only. This is not for your keywords, sorry.
URL:
Only accepted to site related to SEO and you.
For example: SEO company, personal SEO oriented blogg or forum profile of SEO forum.
E-mail:
Optional. If you provide one I can contact you with editing questions and let you know if your answer was approved.

Please verify that all is ok before submitting.



SEO FAQ

Although great efforts are taken to ensure the answers posted in this FAQ are true, no guarantee is made that it is so and no responsibility is taken by this site nor the authors concerning your rankings or SEO activities.