Redirect all users to access the site WITHOUT the \'www.\' prefix


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

Redirect all users to access the site WITHOUT the 'www.' prefix


Copy this code and paste it in your HTML
  1. # redirect all users to access the site WITHOUT the 'www.' prefix
  2. RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  3. RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.