By pavlos on
Hello to all,
I had this habit several years ago to link to my site using both http://www.example.com/ and http://www.example.com/index.php. That was many years ago (about 10) way before I started using Drupal on all my websites.
Now Google seems to be penalising my site for duplicate content, as it has indexed both versions.
I am trying to redirect using the following code in my .htaccess:
RewriteBase /
RewriteRule ^index.php$ http://www.example.com [R=301,L]However when I do this (it works) the login system stops working (I can't login) and I can access the account only via the reset password option. Also when I add the above code the clean urls stop working.
Any ideas on how to achieve this redirection?
Thanks in advance,
Pavlos Skoufis
Comments
Found it...
For future reference...
I added this to the page-front.tpl.php... Running on Apache...
#581152:
#581152: drupalsite.com/index.php should redirect drupalsite.com
My Drupal sites:
Though the code is not very
Though the code is not very elegant, as we are putting logic in template files, where only html's should be printed, but its good tip and working fine!
Also, we can use the https://www.drupal.org/project/globalredirect drupal module for only the "Frontpage Redirect Handler" option from this module's configuration page.