Redirect/Rewrite Subdomain to Subfolder
- by Laurent Ho
I'm trying to redirect a subdomain to a subfolder e.g. forums.domain.com to www.domain.com/forums
Note that I started the forums in the subfolder format but worried that members might mistakenly try to access the forums using the subdomain format.
RewriteCond %{HTTP_HOST} ^(www\.)?forums\.domain\.com
RewriteRule .* /forums [L]
From what I read the codes above should work through .htaccess, but do I still need to create a DNS A record to point to the IP address of the server?