C
CBiLL
Guest
I need to prevent anyone going to my website by using http://domain.com (no www in address) and force thier browser to be redirected to http://www.doman.com (with www in address) because the php script I use have cookie issue and remembering visitor unless they use the www in thier address.
So I tried adding perment redirect to the vhost.conf and restarted apache in plesk service but nothing changes you still could access the website by domain.com and not be redirected to the www.domain.com
Here the rule I tried in vhost.conf to get domain.com redirected to www.domain.com keeping path after it intacted.
<VirtualHost 00.00.00.00:80>
RewriteEngine on
RewriteRule ^/(.*) http://www.domain.com/$1 [R]
</VirtualHost>
Am I doing something wrong? or is there another method to do this?
Thanks
Bill
So I tried adding perment redirect to the vhost.conf and restarted apache in plesk service but nothing changes you still could access the website by domain.com and not be redirected to the www.domain.com
Here the rule I tried in vhost.conf to get domain.com redirected to www.domain.com keeping path after it intacted.
<VirtualHost 00.00.00.00:80>
RewriteEngine on
RewriteRule ^/(.*) http://www.domain.com/$1 [R]
</VirtualHost>
Am I doing something wrong? or is there another method to do this?
Thanks
Bill