SubscribeRewriteCond %{HTTP_HOST} ([^.]+)\.sports.com [NC]
RewriteRule ^(.*) http://sports.com/index.php?id=%1 [P]The rule I gave makes any request to any baseball.sports.com return the same index page, but that's probably not what you want. Unfortunately, I'd need to know a bit more about how your web app is structured before I could do better. For example, given your example just references a generic index page, maybe you just want the subdomain removed from the domain name and added generally as a query. For that, the 2nd line would be RewriteRule (.*) http://sports.com$1?id=%1 [P] . All in all, I'd recommend just doing a browser redirect, since it's well understood by users, and prevents you from having to think too hard about what the various permutations of subdomain URLs.RedirectMatch ^/$ http://www.domain.com/photos so only the top level URL and no others are redirected.RewriteCond %{HTTP_HOST} ([^\.]+)\.sports\.com [NC] instead?You are not logged in, either login or create an account to post comments
RewriteCond %{HTTP_HOST} ([^.]+)\.sports.com [NC]
RewriteRule /index.php?id=%1
should work.
posted by nicwolff at 4:37 PM on August 19, 2005