-1

I have a project in zend framework 1 where, google indexed links with http://www.example.com/index.php/url in them instead of http://www.example.com/url, thus creating duplicates and unwanted links.

I have this rule in htaccess

 RewriteRule ^index\.php(.*)$ /$1 [R=301,QSA,L]

that worked fine until we upgraded Apache to 2.4.6, since then it only redirected links like www.example.com/index.phpurl and not www.example.com/index.php/url, index.php/url does not appear to be included in this expression.

Does anyone know a solution to this?

Cosmin
  • 125
  • 11
  • As I found there is a bug in Apache 2.4.6 https://bz.apache.org/bugzilla/show_bug.cgi?id=53929. I cannot for now change the apache version, so I need a solution to deploy in .htaccess to solve this. – Cosmin May 15 '15 at 06:41

1 Answers1

-1

Try this

RewriteEngine On
RewriteBase /myproject/

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

RewriteRule ^(.+)$ index.php/$1 [L]