Sometimes we need to 301 redirect the index.php file to the domain root as they are canonical urls (ie, http://yoursite.com/index.php and http://yoursite.com are same).
It is only tricky for sites using index.php as the common entry with GET variables controlling the site . In that case we cannot redirect pages with any query string (anything after ? mark).
Following is the solution that’ll redirect any request to homepage of the site to the root url without redirecting any url that has query string.
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteCond %{QUERY_STRING} !(.+)
RewriteRule ^(.*)$ http://www.yoursite.com [L,R=301]
The first line checks if the requested file is “index.php”
Second line checks if there is any query string, if there is any query string, the rewrite will not work.
If the above 2 conditions are met, the url is redirected to the root url.
Cheers!!


#1 by arlekilop on February 21st, 2010
I have considered very carefully what you put, but does take some very attractive moments, some I dissent with you.
Note that previously described past other visitors.
to items and how you go for in the issuance of google for this search” http://www.google.com/ie?as_q=how much are ps3. or is it a secret?
Your aferanas
#2 by leannavab on March 1st, 2010
Excuse for that I interfere … To me this situation is familiar. Let’s discuss. fake ciallis cheap San Jose A joke for you! Where do otters come from? Otter space.
#3 by kizzyzih on March 6th, 2010
You will not prompt to me, where to me to learn more about it? Do you want a fresh joke from net? What do you get when a cat walks along a beach? Sandy Claws!! http://ciallis.sales-rx.info/images/top.gif 1]vigra soft 1]ciallis sale 1]vpxl Alabama
#4 by raylenehic on March 10th, 2010
Unequivocally, excellent message Sorry, for off top, i wanna tell one joke) What kind of necktie does a pig wear? A pigsty. http://rxtadafilusa.001webs.com/images/top.gif 1]vigera buy online USA 1]viagara generic brand ofonline 1]vigra sale online
#5 by DanielLR on March 10th, 2010
I apologise, but, in my opinion, you are not right. Write to me in PM, we will discuss. Oh, good joke) What is always behind time? (besides myself) The back of a watch. viagara low cost
#6 by Ethelynas on March 10th, 2010
True idea cialias gel