| Posted: 28 July 2010 at 1:41pm | IP Logged
|
|
|
I'm using the same expression from a w2003 server that works OK and have copied it over to a new w2008 server and now it doesn't work.
Have enabled logging and I get some output there.
The redirect is non-www to www
The expression I'm using is:
RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^localhost [NC] RewriteRule .? https://localhost%{REQUEST_URI} [R=301,L,NC] RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP_HOST} !^localhost [NC] RewriteCond %{HTTP_HOST} ^(?!(?:www(?:\d+)?|webmail)\.)(.+)$ [NC] RewriteRule .? http(?%1s)://www.%2%{REQUEST_URI} [R=301,L,NC]
The error.log says httpd.conf loaded successfully
The Rewrite.log has some "matched" and "not-matched" results
An extract is:
[domain.com/sid#16][rid#29158896/initial] (4) RewriteCond: input='off' pattern='(on)?' => matched [domain.com/sid#16][rid#29158896/initial] (4) RewriteCond: input='domain.com' pattern='^localhost' => matched [domain.com/sid#16][rid#29158896/initial] (4) RewriteCond: input='domain.com' pattern='^(?!(?:www(?:\d+)?|webmail)\.)(.+)$' => matched [domain.com/sid#16][rid#29158896/initial] (1) escaping http://www.domain.com/ [domain.com/sid#16][rid#29158896/initial] (2) explicitly forcing redirect with http://domain.com/ [domain.com/sid#16][rid#29158896/initial] (2) internal redirect with / [INTERNAL REDIRECT]
Any advice much appreciated, as I need to get this working soon.
Cheers Mike
|