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!

ByteMyPixel
  • 147
  • 9

1 Answers1

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.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143