1

After moving from one server to another the .htaccess-rewrites for removing the index.php stopped working. Old server: PHP 5.3.27 / Apache 2.4.3 New server: PHP 5.6.6 / Apache 2.4.12

There is an index.php in the root-directory and the following .htaccess-directives

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

There is a subfolder called /foo with an index.php and the following .htaccess-directives

RewriteEngine On

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

Now on the new server, whatever I do and whatever I change the index.php in the root-folder is executed. Even if I directly call the URL /foo/index.php I end up with index.php being run.

Unfortunately the hoster is not being helpful at all. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.