views:

24

answers:

2

Hello,

My domain is http://www.somename.com.

I want if an user type {path to website}/index.php, it should redirect him to {site name}

basically I want to remove that index.php from the URL.

and one more thing, it should work both for {www.sitename} {sitename}

any idea is greatly appreciable.

Thanks in advance.

+1  A: 

This rule should do it:

RewriteRule ^index\.php$ / [L,R=301]
Gumbo
Thanks for this cool oneliner ;)
Deepak Ranjan Jena
+1  A: 
Redirect permanent /index.php /

Note: you generally don't want to have a site available on both www and www-less hostnames. Pick one, and have the other variant redirect to it. This will let search engines know for sure they're the same site and not split reputation between them.

bobince
Thats a good point..thanks...
Deepak Ranjan Jena