Posted By

pruntrut on 02/05/12


Tagged

seo-html


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

owenbot


htaccess force www - no www


 / Published in: HTML
 

  1. Force the www.
  2.  
  3. RewriteEngine On
  4. RewriteCond %{HTTP_HOST} ^your-site.com [NC]
  5. RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301]
  6.  
  7. Remove the www.
  8.  
  9. RewriteEngine On
  10. RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
  11. RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]

Report this snippet  

You need to login to post a comment.