PDA

View Full Version : Need help with .htaccess


WritersBeat
01-09-2008, 05:55 AM
I'm moving my forums to a subdomain and I need to translate all current urls to forums.domain.com

RewriteRule ^(.+)\.php\?f=([0-9])$ http://forums.domain.com/forumdisplay.php?f=$2 [R=301,nc]


I tried something like that but it doesn't work :(

AWS
01-11-2008, 02:45 PM
Put this in .htaccess of the root directory of your site

RewriteRule ^forums/(.*) http\\forums.domain\.com$1 [NC,R=301]

Then put a .htaccess file in the subdomain root and change you rules to be something like this


RewriteRule ^(.+)\.php\?f=([0-9])$ /forumdisplay.php?f=$2 [R=301,nc]

You might have to tweak the rules, but, this does work. I migrated a site from directory to subdomain and this is working for me.