index.php pages

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.

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 example need to be redirected to


View Replies: View Best Answer
exchangecore replied on at Permalink Reply
In your .htaccess file add the following:

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} index\.php
RewriteRule ^index.php$ [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 part to be your website.
mesuva replied on at Permalink Reply
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

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?

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

<link rel="canonical" href="" />

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
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 :)