How Do I Do A 301 Redirect? Принт

  • 1

If you need to move a page or a whole website, a 301 redirect is always recommended. If you just change a file name or delete a page, you my lose search engine rankings that were associated with the old page. By using a 301 redirect, you tell search engines and humans where to find the new page.

Avoid using a meta refresh tag as this is a technique used by search engine spammers to rank well for certain keyphrases that are totally irrelevant from the page redirected to. Many search engines filter out the meta refresh tag, so it is not a search engine friendly option.

 To do a 301 Redirect on your website (UNIX server):

1. Locate or create a .htaccess file on your server. Your .htaccess file gives search engine robots instructions on security and redirects.

2. If you don't have an .htaccess file on your server, you can easily create one using a text file such as notepad. Name it ".htaccess" Make sure when you name the file that you remember to put the "." at the beginning of the file name. This file has no tail extension.

3. If there is already an .htaccess file scroll down past the code that is already there and begin your new redirect instructions.

4. Put in your redirect information, which should look like this:

redirect 301 /directory/file.html http://www.domainame.com/directory/file.html

*Please Note: The first part of the information, "/directory/file.html" is the location of the file being moved and the second part  "http://www.domainame.com/directory/file.html" is where the file is being moved. 

*Be sure not to add "http://www" to the first part of the information - just put the path from the top level of your site to the page. Also ensure that you leave a single space between these elements:

redirect 301 (the instruction that the page has moved)

/directory/file.html (the original folder path and file name)

http://www.domainame.com/directory/file.html  (new path and file name )

5. Upload the file to your server.

Please note that there may be slight variations to the coding of the .htaccess file but above is the standard way and should work in most cases.


Дали Ви помогна овој одговор?

« Назад