2

I have a problem with my EE installation. When I try to browse any page (other than the homepage) over SSL i get a 404 error. The whole site works fine over HTTP. Its only when accessing via HTTPS this issue occurs.

My HTACCESS file looks like:

<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# If 404s, "No Input File" or every URL returns the same thing
# make it /index.php?/$1 above (add the question mark)
</IfModule>

I've tried adding the ? in as per the comment on the last couple of rows, but to no avail.

I think the problem is my HTACCESS file, in particular the section that removes the index.php from the URL. If i add the index.php back into the URL then all my pages do work again under SSL.

For example:

https://mysite.com/store/checkout **does not work**
https://mysite.com/index.php?/store/checkout **DOES work**

I'm not enough of an htaccess expert to know how to resolve this. Any advise much appreciated.

2
  • This issue does not occur if you browser the site without https? Commented Feb 13, 2013 at 15:36
  • Exactly right. Viewing the site via http everything works fine. The issue is solely caused by https. (Editting my question to clarify that point) Commented Feb 13, 2013 at 15:41

3 Answers 3

3

Take a look at this: http://kevinthompson.info/blog/2011/03/04/completely-remove-index-php-from-expressionengine-urls.html

I just recently discovered that solution and it's working great on our ecommerce website running with CartThrob and certain pages with https.

1
  • Thanks for taking the time to respond. I did give that a go (its a nice solution Kevin has put together). Unfortunately the issue was down to user (me) stupidity rather than any specific code error. Commented Feb 14, 2013 at 13:10
2

Try changing the $config['uri_protocol'] setting in config.php, as I suggested in this thread:

$config['uri_protocol'] = 'PATH_INFO';

In that thread there are also a few other suggestions to try for the rewrite line:

  • RewriteRule ^(.*)$ index.php/$1 [L]
  • RewriteRule ^(.*)$ /index.php?/$1 [L]
  • RewriteRule ^(.*)$ index.php?/$1 [L]
  • RewriteRule . index.php [L]

Some combination of those two settings usually fixes things.

1
  • Thanks Adrian, I did try that having found your thread in my searches. Unfortunately the issue was down to user stupidity rather than a server config error. Thanks for taking the time to respond. Commented Feb 14, 2013 at 13:09
2

Having gone round in circles for the best part of a day the issue was caused by a painfully simple issue.

My .httaccess file was in the wrong place. Following best practice advise I have moved my system folder above the web root and have the .htaccess file at that level.

Instead the .htaccess file should have been placed in the web root. As soon as I moved it there everything worked as expected.

My folder structure is as follows:

config
content <- web root
    *THIS IS where the htaccess file should be*
system
templates
*this is NOT where the htaccess file should be*

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.