1

I have a redirect setup for www, it successfully redirects to https:// but it includes /index.php?p= in the URL. I'm not convinced by htaccess file is configured correctly.

Here's my htaccess file:

RewriteEngine On

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]

RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

Help much appreciated.

3

There are docs for removing index.php from your URLs here: https://craftcms.com/support/remove-index.php

There are also docs for enforcing SSL for all CP requests here: https://craftcms.com/support/force-ssl

Note that they mention the the SSL rewrite should happen before the index.php rewrite in your .htaccess file.

| improve this answer | |
1

Using MediaTemple, I have this working:

#FORCE HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]

    # REMOVE INDEX.PHP
    RewriteRule (.+) index.php?p=$1 [QSA,L]

</IfModule>
| 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.