Forum Moderators: phranque
I'm having a problem with mod_rewrite, it works the first time I start the apache (2.0.48) server (sometimes) but revists do not work.
As a basic test, I've setup secure dir with a simple index.html file (says it's a secure web page).
Using IE6 and [example.com...] gives a forbidden screen, which is what I want.
Using https, I may see the secure screen but most of the time I keep seeing forbidden screen.
There's been about 1in10 chances on seeing the secure screen and thats been when the server has been restarted.
Config can from the mod_ssl site
<Directory /usr/local/apache/htdocs/secure>
AllowOverride all
RewriteEngine on
RewriteCond %{HTTPS}!=on
RewriteRule .* - [F]
</Directory>
I built the server using
./configure --prefix=/usr/local/apache --enable-ssl --with-ssl=/usr/local/ssl --enable-so --enable-rewrite=shared
And loading the module as follows.
LoadModule php4_module modules/libphp4.so
LoadModule rewrite_module modules/mod_rewrite.so
If I comment out the Rewrite's then the secure page gets displayed using http and/or https, which is what you'd expect (shows that SSL is working OK)
Any mod_rewite debug switches I can turn on since a apache Debug LogLevel does not give any clues?
Thanks in advance
Leigh
Welcome to WebmasterWorld [webmasterworld.com]!
I have never seen this construct used before (although that's not saying much):
RewriteCond %{HTTPS} !=on Specifically, are you sure that "{HTTPS}" is a valid server environment variable?
I've seen
RewriteCond %{SERVER_PROTOCOL} ^HTTP/1\.0$ RewriteCond %{THE_REQUEST} ^GET\ .*\ HTTP/1\.1 I'll confess that the above is just a guess, and the only useful part of this post may be the "Welcome" line... :)
Jim
Another member is reporting intermittent redirect problems, and I'm wondering if this could be a simple stale-cache issue: [webmasterworld.com...]
The cache-control header for secure pages may need to be set for no-cache or must-revalidate with a short expiry time in order to work properly using redirects.
Jim