index.php pages

Permalink
Hello everyone,

I have posted this in forum before but didnt get any answer on that.

I have seen pages resolving on a few sites with the /inex.php extension i.e.
http://www.queenswayorthodontics.co.uk/index.php...

This is bad - it's duplicate content.
And some have been picked up as they are showing Google Analytics.

can some one please give me instruction how I can redirect all urls with index.php extension to /? for examplehttp://www.queenswayorthodontics.co.uk/index.php... need to be redirected tohttp://www.queenswayorthodontics.co.uk...

Thanks

 
exchangecore replied on at Permalink Reply
exchangecore
In your .htaccess file add the following:

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} index\.php
RewriteRule ^index.php$ http://www.yourdomain.com/ [R=301,L]


If you're already using pretty URL's you probably already have the first two lines in there. Make sure to update the yourdomain.com part to be your website.
mesuva replied on at Permalink Reply
mesuva
Just a note to be careful with this - I've seen someone add a similar redirect to a concrete5 site's htaccess (trying to remove duplicates) and it broke editing blocks and dashboard actions.

Some requests in c5's system specifically go to index.php. If you put in the wrong re-write, those specific requests will be re-written and won't work.
northsid replied on at Permalink Reply
Hello,

Yes I just tried this and it worked, but when i try adding blocks or update it gives me error msges! is there any other way to do this?

Thanks
mesuva replied on at Permalink Best Answer Reply
mesuva
Instead of doing it with a redirect, you could add:

<link rel="canonical" href="http://www.queenswayorthodontics.co.uk" />

via the 'Header Extra Content' custom page attribute of the home page.

Search engines should see that if they hit the homepage via an index.php URL and not treat it as a duplicate.

You could this for each page you need to remove a duplicate form.
exchangecore replied on at Permalink Reply
exchangecore
As mesuva mentioned there are other implications to this which just can't be avoided because c5 makes POST requests to /index.php and apache doesn't pass POST data forward on a redirect so.... Kinda out of luck there.

Might be best to go with the canonical link suggestion that was made.
northsid replied on at Permalink Reply
Great thank you so much guys :)