Forum Moderators: phranque
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com [NC]
RewriteRule ^(.*)$ http://www.anythingelse.com/$1 [R=permanent,L]
I actually redirected anyone coming to my site to google.com as a test to see if the mod_rewrite was even working, and it actually worked. But what I want to get to work is something like this:
RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=permanent,L]
Finally, I turned on the rewritelogs feature, and I think I've noticed the problem, although I don't have any idea what is causing it, or how to be rid of it. In the logs you can see, among other things, the "input" and you can see where it is tested to see if it matches the pattern you've set in the condition line. Throughout all the logs, I never could find an instance where the input was simply mydomain.com, it was always www.mydomain.com. I explicitly used http://mydomain.com when testing, but again, it never appears in the logs. Sorry for the extreme detail, but I'm about to have a nervous breakdown if I can't get this to work soon. I appreciate any and all advice. Thanks in advance.
-dumbstruck
[edited by: jdMorgan at 10:56 pm (utc) on July 28, 2007]
[edit reason] De-linked [/edit]