Forum Moderators: phranque

Message Too Old, No Replies

What do I add to htaccess to rewrite dir/index.html requests to /

to / of any public folder?

         

Fribble

3:30 am on Dec 5, 2005 (gmt 0)

10+ Year Member



So far I've got this to go from non-www to www:
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Now I want to have .htaccess redirect (301) all requests for /index.html's and /index.php's to the / of the folder. (Just a trailing slash)

For example:

requests for http://www.example.com/index.html
go to http://www.example.com/

and requests for http://www.example.com/folder/index.php
go to http://www.example.com/folder/

Anyone?

Thanks :)

[edited by: jdMorgan at 3:45 am (utc) on Dec. 5, 2005]
[edit reason] example.com [/edit]

jdMorgan

3:54 am on Dec 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's the thread you're looking for: [webmasterworld.com...]

BTW, I stand by the original code I posted as being the correct solution, although the thread owner states that he changed it (for an unspecified reason).

Jim

Fribble

4:28 am on Dec 5, 2005 (gmt 0)

10+ Year Member



Thanks jdMorgan, that's just what I was looking for.