Forum Moderators: phranque

Message Too Old, No Replies

redirect index.html 301 redirect

.htaccess 301 redirect

         

froggger

8:33 am on Aug 12, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



I have the below code redirect ok but when the web address shows the index.html after it doesnt redirect ie.

I want [name.com.au...] redirect to [name.com.au...]

This is the code I am currently using.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^name\.com\.au$ [NC]
RewriteRule ^(.*)$ [name.com.au...] [R=301,L]

Can anyone please help

g1smd

9:53 am on Aug 12, 2009 (gmt 0)

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



There's nothing in that code to detect that "index.html" is in the request.

You'll need to add a few more lines of code before the redirect that you already have.

Luckily, as this is a regular question here, there are many prior examples to choose from (see forum charter).

Post your best effort code as a basis for discussion.

froggger

10:02 am on Aug 12, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks g1smd for your quick response.

I found this but it doesnt seem to work with Firefox.

RewriteRule ^index\.html$ "http\:\/\/name\.com\.au" [R=301,L]

jdMorgan

11:56 pm on Aug 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you found that code posted here at WebmasterWorld as a 'final answer', then please post the URL to that thread, because that code is badly wrong and needs to be corrected. (Thanks)

Search WebmasterWorld [webmasterworld.com] for redirect index rewritecond the_request to get to better (and working) examples.

Jim