0

I have followed the instructions for removing index.php and it works on all pages with the exception of pages with channels. So I would see http://www.example.com/index.php?p=news/2016/news-title.

I also added the 'omitScriptNameInUrls' => true, in the general.php file.

Here is what I have in my .htaccess file

<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]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/svg+xml
</IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
7
  • Are you using Craft's stock .htaccess file? – Brad Bell Mar 16 '16 at 18:23
  • Ive revised my answer to show what I have in there. – Matthew Carleton Mar 17 '16 at 12:35
  • Is the 2nd block "Options +FollowSymLinks" just a SE formatting issue, or is that part of the same .htaccess code in the first chunk? – Brad Bell Mar 17 '16 at 21:41
  • ya it's a redirect for the www – Matthew Carleton Mar 18 '16 at 17:21
  • Try moving the www rewrite rule above the Craft rewrite. – Brad Bell Mar 18 '16 at 23:05
0

So it turns out I needed to have the "Options +FollowSymLinks" block above the craft rewrite rule in my htaccess. See comments above.

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.