What are 301 redirects?
It is the status code that has been sent back to your browser from the web server. In other words, the “301 status”, is telling your browser that the link you typed in or clicked on has moved permanently to the new address that you have just been forwarded to.
When would I use a 301 Redirect?
One reason is to redirect your current domain name to a new domain name. If you changed your domain name for example. It could also be used for redirecting individual pages if a page has moved and you want to redirect old links to a new page. Today we just talk about updating your site to use a new domain name.
-
How do I redirect my old domain name to a new domain in Linux/Unix
- Ideally you should make a copy of your existing site. Either on a new hosting account or as a new domain on your existing account (if your host allows it). When both sites (old and new) are set up and working individually with their own domain names, you can proceed to redirect your old domain name to your new domain name.
- Create a .htaccess file in the root directory of your old website. You can also create the file on your own computer first than ftp it in. If using Windows, you could name it “htaccess” then rename it “.htaccess” from your ftp program after you upload.
- Copy and paste this code into that file, changing the “www.yourdomain.com” text to your new domain name:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] - That is all there is to it, it immediately goes into effect. You can test it by opening a new browser and typing in any link to your old site. It should redirect to the same page on your new site. If it does not, check to ensure that you added a period in front of the .htaccess file
How do I redirect my old domain name to a new domain in IIS (Internet Information Server) on Windows?
You will probably need to talk to your host to determine the best method. If you have admin access to your server you can do this:
- Right click the folder or website you want to redirect and click Properties.
- On the Home Directory (or Virtual Directory) tab, click the “A redirection to a URL” option.
- Enter the domain name or page you want to redirect to.
- Check the “A permanent redirection for this resource” option.
- Save by clicking OK. Then test by opening a new browser and going to an old link. It should redirect to the new domain.
Additional Resources:
Google recommends using 301 redirects if changing the domain name of your existing site to get the best results in their index.
July 29th, 2012 at 6:40 am
Love the information and tone of site I found it top banna have a great day and thanks for valuable data
See my own Site Brsnd Designers