Welcome to WebmasterWorld Guest from 23.20.223.88

Forum Moderators: goodroi

Message Too Old, No Replies

index.html

redirect in htaccess file

     
3:05 pm on Oct 29, 2009 (gmt 0)

5+ Year Member



I think this is my first post here :)

Although G is smart enough to understand that www.mysite.com
is the same with mysite.com its still a good Idea to have a redirect like this on top of the htaccess file:

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

Should I do this for the /index.html version to the non /index.html version?

I see that google has the [google.com...]

but not the [google.com...] version.

Any thoughts on this?

Regards,
Radu

3:23 pm on Oct 29, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There are many threads with better-coded and more-complete Hostname and URL canonicalization solutions in our Apache Server forum [webmasterworld.com]. Also take a look at our Apache Forum Library.

Jim

3:53 pm on Oct 29, 2009 (gmt 0)

5+ Year Member



Thank you for the answer Morgan,

And sorry for the post :)

If anyone will have the same question as me, this is the answer:

RewriteCond %{THE_REQUEST} ^.*\/index\.html?
RewriteRule ^(.*)index\.html?$ [mysite.com...] [R=301,L]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month