MultiViews removing .php and redirects not working

114 Views Asked by At

I have a problem with multi-view being enabled to get rid of the the file extension .php globally across the whole site and this works fine.

But now, not all the 301 redirect's work. We have lots of old inbound (good quality) links that need to go to these new urls and some need to be taken to brand new urls.

In the htaccess file this works:

Redirect 301 /files/Menu.pdf http://www.example.co.uk

This works, but a trail of the url gets added onto the redirected url:

Redirect 301 /section.php/11/1/life-drawing http://www.example.co.uk

This doesn't work:

Redirect 301 /section/116/1/drawings http://www.example.co.uk

Here are the contents of the htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.co.uk [NC]
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.example.co.uk/ [R=301,L]

RewriteEngine on
Options +SymlinksIfOwnerMatch +MultiViews
RewriteRule ^(.*).php/(.*) $1.php?$2

Redirect 301 /files/Menu.pdf http://www.example.co.uk
Redirect 301 /section.php/11/1/life-drawing http://www.example.co.uk
Redirect 301 /section/116/1/drawings http://www.example.co.uk

Tried this and no luck either:

RewriteRule ^section/101/1/example-here$ http://www.example.com/ [R=301,L]

Any help would be very much appreciated.

0

There are 0 best solutions below