0

I am using .htaccess redirection rule for removing index.php from URL and it works good when I try to access mysite.com/index.php redirecting me on mysite.com. Redirection rule I use in .htaccess is exactly:

RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ http://e-tribina.com/$1 [R=301,L] 

But when I try to access URL for ex. mysite.com/index.php/folder/folder1 it still works. It not removing index.php from middle of URL. And my Google webmaster tool showing me duplicate descriptions/keywords for mysite.com/folder and mysite.com/index.php/folder and both links still works.

Any htacces rule to remove index.php from middle of URL and redirect to URL without it?

Using Joomla 2.5.11. btw.

Appriciate any help.

1
  • normally you can just rename the included htaccess.txt file with joomla to .htaccess. Then go to the global configuration and check the site tab. On the right the first two items (Search Engine Friendly URLs and Use URL Rewriting) should both be on and you won't see index.php at all. Commented May 21, 2013 at 4:54

2 Answers 2

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

You have to check the end of a string, not the beginning. Also, in case you have index.php in a sub folder, the third rule will take care of that (provided you have the necessary silent rules for them).

Note: only use R=301 if it works for you. Otherwise, for testing, just use R.

Sign up to request clarification or add additional context in comments.

Comments

0

First rename htaccess.txt to .htaccess.

then goto global configration and set Use URL rewriting - Yes

then save & check

may this one very help !

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.