Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>

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

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

1 Answer 1

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

 
discard

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.