|
|
Subject:
.htaccess Domain Redirects
Category: Computers > Internet Asked by: niallr-ga List Price: $10.00 |
Posted:
08 Mar 2006 08:52 PST
Expires: 07 Apr 2006 09:52 PDT Question ID: 704962 |
Hi, I'm looking for information on how to do a .htaccess redirect from one domain to another. For example if I wanted to redirect all the traffic from www.something.com to www.somethingelse.com I know this can be done page by page with redirects but I'm looking for a solution to redirect the entire domain to another one. Thanks Niall |
|
Subject:
Re: .htaccess Domain Redirects
Answered By: palitoy-ga on 08 Mar 2006 09:42 PST |
Hello niallr-ga, Thank-you for your question. If I understand your question correctly you need to alter your htaccess file to redirect a domain to another domain. These types of request are notoriously difficult to troubleshoot online so if you have a problem with the code below please do not hesitate to ask for clarification. RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?something\.com RewriteRule ^(.*)$ http://www.somethingelse.com/$1 [R=301,L] The above code should be copied into an htaccess file and uploaded to the root directory of your server. The code means that if the URL that the user enters matches www.something.com or something.com then all of the pages the user tries to access will be redirected to the same page at http://www.somethingelse.com. The [R=301,L] means that the server is sending a 301 redirect (that is the page is permanently redirected) and the "L" indicates this is the last rule. Once again, if you need any further assistance on this matter please do not heistate to ask for clarification. Further reading: http://www.widexl.com/scripts/documentation/mod_rewrite.html#redirect_domain http://www.serve.com/faq/index.php?faq_option=faq&id=95#rewrite http://www.olate.co.uk/articles/259 http://www.gnc-web-creations.com/301-redirect.htm http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html http://httpd.apache.org/docs/2.0/misc/rewriteguide.html |
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |