Posted By

bbnnt on 08/10/08


Tagged

apache config


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

bbnnt


apache config file remove www from url


 / Published in: Apache
 

remove the www usually located at the beginning of the url : www.url.com -> url.com http://www.url.com/file.html -> http://url.com/file.html http://www.url.com/directory/file.html -> http://url.com/directory/file.html etc...

  1. RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  2. RewriteRule ^(.*)$ http://example.com$1 [R=301,L]

Report this snippet  

You need to login to post a comment.