How To Do a 301 Redirect
How To Do a 301 Redirect
A 301 redirect is simply a permanent redirect from an old web page address
(i.e. www.xyzname.com/OldPage.html) to a new page address (i.e. www.xyzname.com/NewPage.html). The redirect is used to provide search engines and website visitors with the new content when they try to access it from an old link or browser bookmark. The instructions for this page-to-page redirect are listed after the short paragraph & navigation below.
Note: There are also other, more complex, uses of a 301 redirect and details along with instructions can be found on the pages linked to below:
Instructions for How to Redirect an Old page to a New page
- If you are not familiar with managing a website from a technical standpoint you should simply tell your webmaster to create the redirect. Just tell him/her the old address and where the new address is and they will take care of it for you.
- If you are going to handle this on your own please pick the type of server your website is operating on below and proceed with the appropriate instructions.
— Websites on Unix/Apache Servers
- FTP into your website and in the root folder download then create a copy of the .htaccess file and save it in a backup folder so you can start from a working file if you make a mistake.
Note: If you cannot find your .htaccess in your FTP file list see this tutorial and if it does not help please contact your server administrator for help. - Now open the .htaccess in a program like Notepad++ (an excellent free program) and prepare to type on a new line at the bottom of the existing code.
- Now put in the redirect based on the following example (pay close attention to the spacing between the words)
redirect 301 /OldPage.html http://xyzname.com/NewPage.html - Save and Upload the file to your server and test the redirect by going to the old URL (i.e. www.xyzname.com/OldPage.html) and seeing if you are sent to the NewPage.html.
- I also suggest being 100% certain a 301 redirect is being provided by using our free Server Header Checker Tool where you can copy and paste in the old address and to see for certain it is working properly.
— Websites on Windows Servers
If you are using a Windows server I am sorry to say page-to-page redirects are rather clunky because a page has to exist at the old location to redirect visitors to the new location. In addition, there are two ways to create a redirect based on the codebase used:
Step 1) Place a page at the position of the old web page address (http://xyzname.com/OldPage.asp)
Step 2) There are now two options for code to be placed:
If you are running a standard ASP website then place the following code above the tag or :
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://xyzname.com/NewPage.asp”
%>
If you are running an ASP.Net website, then place the following code above the tag or >:
Step 3) Upload the new page and then test it by visiting the old URL and making sure you are redirected properly.
Step 4) Double-check a 301 redirect is being displayed by copying and pasting the old URL into our free Server Header Checker Tool.
A 301 redirect is simply a permanent redirect from an old web page address
(i.e. www.xyzname.com/OldPage.html) to a new page address (i.e. www.xyzname.com/NewPage.html). The redirect is used to provide search engines and website visitors with the new content when they try to access it from an old link or browser bookmark. The instructions for this page-to-page redirect are listed after the short paragraph & navigation below.
Note: There are also other, more complex, uses of a 301 redirect and details along with instructions can be found on the pages linked to below:
IMPORTANT: 301 redirects are a critical step in ensuring your website is search engine friendly. That said, there are over 120 elements that also contribute to maximum search engine friendliness. These elements are discovered by conducting an effective SEO Website Audit.
Learn more:
How to 301 redirect non-www to www URLs
How to 301 redirect an old domain to a new domain
Instructions for How to Redirect an Old page to a New page
- If you are not familiar with managing a website from a technical standpoint you should simply tell your webmaster to create the redirect. Just tell him/her the old address and where the new address is and they will take care of it for you.
- If you are going to handle this on your own please pick the type of server your website is operating on below and proceed with the appropriate instructions.
— Websites on Unix/Apache Servers
- FTP into your website and in the root folder download then create a copy of the .htaccess file and save it in a backup folder so you can start from a working file if you make a mistake.
Note: If you cannot find your .htaccess in your FTP file list see this tutorial and if it does not help please contact your server administrator for help. - Now open the .htaccess in a program like Notepad++ (an excellent free program) and prepare to type on a new line at the bottom of the existing code.
- Now put in the redirect based on the following example (pay close attention to the spacing between the words)
redirect 301 /OldPage.html http://xyzname.com/NewPage.html - Save and Upload the file to your server and test the redirect by going to the old URL (i.e. www.xyzname.com/OldPage.html) and seeing if you are sent to the NewPage.html.
- I also suggest being 100% certain a 301 redirect is being provided by using our free Server Header Checker Tool where you can copy and paste in the old address and to see for certain it is working properly.
— Websites on Windows Servers
If you are using a Windows server I am sorry to say page-to-page redirects are rather clunky because a page has to exist at the old location to redirect visitors to the new location. In addition, there are two ways to create a redirect based on the codebase used:
Step 1) Place a page at the position of the old web page address (http://xyzname.com/OldPage.asp)
Step 2) There are now two options for code to be placed:
If you are running a standard ASP website then place the following code above the tag or :
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://xyzname.com/NewPage.asp”
%>
If you are running an ASP.Net website, then place the following code above the tag or >:
Step 3) Upload the new page and then test it by visiting the old URL and making sure you are redirected properly.
Step 4) Double-check a 301 redirect is being displayed by copying and pasting the old URL into our free Server Header Checker Tool.
Have you got a basic or advanced question about 301 redirects or perhaps SEO? Post your question on the SEO 101 Radio Facebook Page & we will answer your question! SEO 101 on WebmasterRadio.fm airs live every Monday at 2pm PST / 5pm EST. (SEO 101 on iTunes)