How to do a 301 Directory Redirect?
-
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?
-
Answer:
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-a-webpage.php 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!
Shannon at Yahoo! Answers Visit the source
Related Q & A:
- How to limit mod_rewrite to a single directory?Best solution by Stack Overflow
- How to write temporary files from temporary path to a temporary directory?Best solution by msdn.microsoft.com
- How to use htaccess to point to a different directory?Best solution by Stack Overflow
- How to set permanent 301 redirect with htaccess?Best solution by Quora
- How to move a website through redirect?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.