Forum Moderators: phranque

Message Too Old, No Replies

Rewrite Rules Over SSL Connections Ignored

         

w2k2kc

8:26 am on Jan 24, 2011 (gmt 0)

10+ Year Member



I have a simple rewrite rule in my .htaccess file that creates search engine friendly urls for my visitors. The rule works great over http connections, but for some reason when the request is made over https the rule is ignored.

Here is the contents of the .htaccess file:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z\-]+)/$ /$1.php [L]
</IfModule>


Any ideas or suggestions as to why https requests ignore the rule, but http requests follow the rule? Any help would be greatly appreciated. I spent the entire day on Google and various forums to no avail.

Please let me know if more details would be helpful.

Thanks!
Jeremy

jdMorgan

12:36 am on Jan 25, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The most likely cause is that the HTTPS files are stored separately, or that the HTTPS configuration specifies either a separate filepath or disallows the execution of mod_rewrite code for HTTPS requests.

It might be faster to ask your hosting company about your problem in your specific server configuration that to try to guess the problem, here.

Jim

w2k2kc

7:44 pm on Jan 26, 2011 (gmt 0)

10+ Year Member



Hi Jim - I just wanted to say thank you for taking the time to answer my question. Your reputation as a knowledgeable and helpful Apache expert precedes you.

I believe the problem has something to do with my local Apache configuration. I'm using MAMP (on Mac OSX). It seems like there's some proprietary configuration directive that's overwriting my ssl.conf file. I've posted my question (with your insights in their forum). I'll let you know what I find out.

Thanks!
Jeremy