About redirect /index.php

16 years 7 months ago #2237 by netfly
Hello Saka,

I created a redirect from mydomain.com/index.php to mydomain.com
However, I have a problem with other url containing index.php in the name. For example I use Google Search integrated to my joomla site. The results are displayed into a page in my website. Google Search open a new page with url /index.php?domains=mydomain.com&q=keyword&sitesearch=domain.com&sa=Google+Search&client=etc.
In this case, the page is redirected to mydomain.com

Do you know if there is a solution to prevent this problem?

Best Regards.

Please Log in or Create an account to join the conversation.

16 years 7 months ago #2238 by Saka
Sure,

Use this one in your .htaccess (replace yoursite.com with your own domain):

After: RewriteEngine On

# Redirect requests to index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ www.yoursite.com/ [R=301,L]

Before: # RewriteBase /

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

16 years 7 months ago #2239 by netfly
It's absolutely PERFECT Emir  ;D :D ;D :D ;D

One more SEO improvement in my website. I'm actually high ranked in Google and Yahoo. SEFadvance is part of this success.

Thanks a lot  ;)

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch