Remove www for urls
Remove www for urls
What is the correct way in vestcp to redirect requests for www.example.com to example.com?
Re: Remove www for urls
You can use .htaccess
Re: Remove www for urls
Thanks, that's perfect.
If anyone else needs to do this in .htaccess in the web root directory:
If anyone else needs to do this in .htaccess in the web root directory:
Code: Select all
RewriteEngine on
# remove 'www.' from URLs
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]