View Full Version : .htaccess Rewrite

03-08-2008, 05:47 AM
I would like to use .htaccess whereas when a user visits subdomain.domain.com, they are automatically redirected to domain.com/subdomain (I've already set this up), but the address appearing in their address bar still says subdomain.domain.com.

Thanks in advance.

03-08-2008, 01:03 PM
That'll be because you're doing a rewrite, not a redirect. Either change your rule to:

Redirect {subdomain} {subdirectory}

...or add the directive [R=301] at the end of the rewrite rule.

03-10-2008, 03:13 AM
Thanks a lot, I've gotten it to work perfectly.