Use subdomain for certain urls

Try this (untested):

# BEGIN Forums Rewrite
RewriteCond %{HTTP_HOST} !^www\.domain.com
RewriteCond %{HTTP_HOST} ([^.]+)\.domain.com
RewriteRule ^(.*)$ forums/%1
# END Forums Rewrite

It should work with both your requirements. You don’t need the second one (rewriting the forums folder to subdomain) because rewriting the actual forum ID will override the basic subdomain rewriting forums.domain.com/forumid=16.

You should add these lines after those generated by WordPress.

Leave a Comment