Nick
Nick

Reputation: 382

Pages 404ing when on https://

I've just installed an SSL on my server and enabled https on my websites admin area however now when normal pages are accessed with https:// instead of http:// I get a 404 page. This is my htaccess, it has the standard expressionengine index.php removal in as well but I can't work out what I need to change to make https:// work if front-end pages are accessed with it, any ideas?:

<IfModule mod_rewrite.c>
        RewriteEngine On

        # force https for all URLs in /admin.php
        RewriteCond %{HTTPS} =off
        RewriteRule ^admin.php https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

        # Redirect index.php Requests
        # ------------------------------
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{THE_REQUEST} !/system/.*
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

        # Standard ExpressionEngine Rewrite
        # ------------------------------
        RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Upvotes: 1

Views: 78

Answers (1)

anubhava
anubhava

Reputation: 784948

Replace all of your code with this:

RewriteEngine On

# force https for all URLs in /admin.php
RewriteCond %{HTTPS} off
RewriteRule ^admin\.php https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{REQUEST_URI} !/system/ [NC]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

Upvotes: 1

Related Questions