Question:

How to do a 301 Directory Redirect?

by  |  earlier

0 LIKES UnLike

I have an entire site devoted to Labrador Retriever Gifts as well as Dog Gifts site devoted to all 155 dog breeds.

Now, I used to have a Lab section under the latter but want all links to anything in that section to redirect the user to the former (no sense in keeping up a section on the letter if I have an entire site devoted to Labs).

I set the redirect to be (examples - not real site):

301 redirect /store/oldlabssection http://www.currentlabstore.com

If my customers now click on a link out there to /store/oldlabssection/chocolate.html will it still send them to currentlabstore.com?

If not, what is the correct 301 redirect statement to be used to have every link that exists out on the Internet to anything under the old section redirect them to the other website?

 Tags:

   Report

1 ANSWERS


  1. You cannot redirect from a client based on a 301 code. This is done from the server side. If you manage your own server, here's a link on the different types of 301 redirects:

    http://www.webconfs.com/how-to-redirect-...

    If you do not, the best way would probably be to redirect each page or just change the links. If you go with the former, the code would be something like this:

    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourpage.com">

    (This would go in between the <HEAD></HEAD> tags)

    If my understanding is correct, you want other people's pages that link to your lab section to be redirected. Obviously you can't control what other sites do. Your best bet is probably to just put the above code on each page that you do not want to exist anymore and would rather forward.

    If these pages actually do not exist and you do not manage your own server you can still achieve what you're trying to accomplish. If your site is running on an Apache server then all you have to do is add the following to your .htaccess file:

    Redirect   /dirORpage2beRedirected   http://www.yourpage.com

    If there is no .htaccess file then create it and set the permissions to Read-Everyone. Or you can contact whoever manages your server to do this for you.

    If you're running your website on an IIS server, you're going to have to contact the company that manages your server and have them redirect all 301/404 codes to the desired location.

    If you are not sure what type of server you are running your site on, check with the company that hosts your site. Hope this helps!

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.