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.

  • This issue does not occur if you browser the site without https? – Mark J. Reeves Feb 13 '13 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) – Tomtids Feb 13 '13 at 15:41
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.

| improve this answer | |
  • 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. – Tomtids Feb 14 '13 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.

| improve this answer | |
  • 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. – Tomtids Feb 14 '13 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*
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.