Forum Moderators: phranque

Message Too Old, No Replies

Problem in indexing of home page (index.php)

         

sanjeevkumaar

9:08 pm on Sep 22, 2011 (gmt 0)

10+ Year Member



Hello friends, I have upload following coding in .htacces file of my website. (replace abc=mydomain name)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com
RewriteRule (.*) [abc.com...] [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ [abc.com...] [R=301,L]



But I'm facing problem that my index.php page is not being indexing with www.

g1smd

9:23 pm on Sep 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use example.com in this forum to stop URL auto-linking.

You have a double redirect when example.com/index.php is requested. The first rule redirects to www.example.com/index.php then the second rule redirects to example.com/

You MUST swap the rule order so that the index rule is first and the non-www rule is second.

Both rules MUST include the protocol and hostname in the RewriteRule target.

Your index rule does NOT fix index.php requests in folders. You should amend it to do so.

You non-www rule does NOT fix many types of non-canonical request (appended port numbers, etc). It needs amending.