Greetings,
I am working on a site where we are using a subdomain (dir.domain.com). Previously, the users were accessing the folder directly (
www.domain.com/dir), but we want to force them to use the subdomain.
I've tried to do it using the mod_rewrite, but having trouble. This is what I have:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com
RewriteRule ^/dir(/.*)?$ http://dir.domain.com$1 [R=301,L]
It doesn't seem to be working properly, though. When I type in
http://www.domain.com/dir/whatever.php, there's no redirect.
Any pointers appreciated. Thanks.