Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite not working under SSL

Mod rewrite and mod ssl do not work together when accessing https

         

frequencydip

4:22 pm on Sep 16, 2009 (gmt 0)

10+ Year Member



I have searched endlessly and can't find a solution to my problem. I have mod_rewrite working fine under http:// when I try to access the same pages under https:// I get a 404 file not found error. It seams like mod_rewrite is not enabled under SSL or the .htaccess file is not being loaded under SSL.

Here is what I have so far,
My vhost.conf:
<VirtualHost *:443>
RewriteEngine on
SSLEngine on
SSLCertificateKeyFile /var/www/certs/file.key
SSLCertificateFile /var/www/certs/file.com.crt
SSLCACertificateFile /var/www/certs/file.crt
ServerName stage.com
DocumentRoot "/var/www/stage"
CustomLog "/var/log/httpd/stage_access_log" "%h %l %u %t \"%r\" %>s %b"
ErrorLog "/var/log/httpd/stage_error_log"
<Directory "/var/www/stage">
Options +FollowSymLinks
AllowOverride All
<IfModule mod_dav.c>
DAV Off
</IfModule>
Options -Includes -ExecCGI -Indexes
</Directory>
<Directory "/var/www/stage">
</Directory>
ServerAlias *.stage.com
</VirtualHost>

From my .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_URI} !/blog.*
RewriteCond %{REQUEST_URI} !/plaxo.*
RewriteRule .* index.php

When I load [stage.com...] it works fine [stage.com...] fails I can however load [stage.com...] fine via https so I know SSL is working

Thanks in advance for any help anyone can give.

jdMorgan

4:31 pm on Sep 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may want to review the mod_rewrite documentation [httpd.apache.org], with an eye toward determining the meaning of this directive...

RewriteCond %{HTTPS} !=on

Please don't try to 'guess' or cut-n-paste server config code... You can severely damage your site's operation and/or search engine ranking with even just one little typo. This is dangerous stuff, and should be treated accordingly.

Jim