Force www for main domain?
Force www for main domain?
Can anyone help me doing so both my default template and my force-ssl template also forces www for main domain.
When I say main domain I mean like world.com, not hello.world.com.
Thanks in advanced.
I am noob with VestaCP
When I say main domain I mean like world.com, not hello.world.com.
Thanks in advanced.
I am noob with VestaCP
Re: Force www for main domain?
htaccess - simple way
or another option
Code: Select all
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
Code: Select all
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]