apache config file remove www from url

/ Published in: Apache
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  2. RewriteRule ^(.*)$ http://example.com$1 [R=301,L]

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.