Posted By

beneberle on 08/16/11


Tagged

unix htaccess


Versions (?)

.htaccess domain redirects


 / Published in: Bash
 

  1. ###### always access from www and redirect multiple doamins to one
  2.  
  3. rewriteCond %{http_host} ^domain\.com$ [OR]
  4. rewriteCond %{http_host} ^domain\.org$ [OR]
  5. rewriteCond %{http_host} ^www\.domain\.org$ [OR]
  6. rewriteCond %{http_host} ^subdomain\.domain\.org$ [OR]
  7. rewriteCond %{http_host} ^www\.subdomain\.domain\.org$ [NC]
  8. rewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]
  9.  
  10. ######always access from non-www and redirect multiple doamins to one
  11.  
  12. rewriteCond %{http_host} ^www\.domain\.com$ [NC]
  13. rewriteRule ^(.*)$ http://domain.com/$1 [r=301,L]

Report this snippet  

You need to login to post a comment.