4

I am having the same issue as here: Another index.php?p= problem

I tried to post this as a comment rather than open another post but I don't have enough reputation...

I have tried all of the suggestions listed and none of them are working. Without index.php I get 404's.

I've tried with the rule applied to the config file it breaks the admin (doesn't load asset files like css - they're still pointing to URLs with index.php) and I still get 404's on the entry URLs.

I also double checked with the hosting company on the apache configurations and the AllowOverride All is indeed set.

Here is 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>

I did try to add RewriteBase / just below RewriteEngine On and nothing happened. I also verified the file is actually working by adding invalid stuff in it and getting a server error.

I've tried this in my general.php config file:

return array(
    'omitScriptNameInUrls' => true,
);

And this version:

return array(
    '*' => array (
        'omitScriptNameInUrls' => true
    )
);

When I do, it doesn't fix the index.php issue, but it removes index.php from the admin, but breaks the admin because the assets 404 (mentioned above).

Any other suggestions out there?

Thanks!

  • What happen if you go to http://yourdomain.com/index.php/testPathInfo? – Brad Bell Sep 15 '16 at 22:55
  • I get the "success" message, forgot to mention I tried that one too :/ (just checked again to be sure ;) ) – ByteMyPixel Sep 15 '16 at 23:00
  • Do you have any .htaccess files in folders above Craft's .htaccess file? – Brad Bell Sep 15 '16 at 23:13
  • I don't, here is a screenshot of the folder structure on the server: link – ByteMyPixel Sep 15 '16 at 23:19
  • Hrm... forgive me if this sounds stupid, but you are running Apache? – Brad Bell Sep 16 '16 at 1:22
4

In this case, the Apache mod_rewrite module wasn't installed, so the <IfModule mod_rewrite.c> block of Craft's default .htaccess file was being skipped not allowing index.php to be rewritten in the URL.

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