Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following .htaccess file, which worked fine on my old host. I moved over to an AWS instance (Ubuntu 12.04 LTS), and it's no longer completely working:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php

I know rewrite is installed, because this is partly working - it does send HTTP requests to HTTPS. Also, it does show up in the list of running modules. However, I can't use URLs without index.php anymore, as it all comes up as 404. Since this is an exact copy of a site that was already working, I figure I must have done something wrong when installing apache, but I can't imagine what.

share|improve this question
up vote 0 down vote accepted

In spite of cool kids voting the question down without explanation, I managed to figure it out. The problem was that since it's HTTPS, changing AllowOverride to All in /etc/apache2/sites-enabled/default wasn't working. You need to edit default-ssl in that case.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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