owatagal Posted May 19, 2006 Posted May 19, 2006 (edited) I moved my forum to a subdomain because I want to track the stats separately from the rest of the site. The move went fine -- ht*p://forum/mysite.dom/ appears to be working correctly. Unfortunately, so is ht*p://mysite.dom/forum -- I understand how subdomains work and that this is the actual folder and all that, but is there a way to redirect any traffic that happens to go here to the subdomain address (ht*p://forum.mysite.dom)? I want to make sure the traffic is counted in the subdomain's Awstats, not the main site's Awstats. I hope I'm making sense. I'm just afraid trying something like a 301 redirect (ht*p://mysite.dom/forum to ht*p://forum.mysite.dom) will cause an internal server error, blow up the Internet, cause a rift in space/time, etc. (Kidding... but with my site at 400x the normal traffic for this month, I really don't want to cause an internal server error and lose this sudden new audience, even temporarily). Edited May 19, 2006 by owatagal Quote
TCH-Bruce Posted May 19, 2006 Posted May 19, 2006 How about a mod rewrite rule in the .htaccess file? Quote
TCH-JimE Posted May 19, 2006 Posted May 19, 2006 TCH bruce is write (sorry very poor pun) >RewriteCond %{HTTP_HOST} ^[www\.]*sub-domain-name.domain-name.com [NC] RewriteCond %{REQUEST_URI} !^/sub-domain-directory/.* RewriteRule ^(.*) /sub-domain-directory/$1 [L] Put that in your htaccess and that will rewrite your url JimE Quote
TCH-Bruce Posted May 19, 2006 Posted May 19, 2006 Thanks Jim, if I was any good at rewrite rules I would have provided it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.