Forum Moderators: phranque

Message Too Old, No Replies

redirect index file only

having trouble just getting index file to redirect

         

jpl80

1:57 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



So, I want to redirect traffic from:

http://somewhere/writing/index.html

to:

http://overhere/blogs/

I used this in my .htaccess file in the writing directory

RewriteRule ^index.*$ http://overhere/blogs/ [R=301,L]

which works fine unless someone just visits:

http://somewhere/writing/

which takes them to the default 'index.html' page

Can anyone help?

jdMorgan

11:47 pm on Jul 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the problem is that you want requests for both "/index.html" and "/" to redirect, then make "index.html" optional:

RewriteRule ^(index\.html)?$ http://overhere/blogs/ [R=301,L]

Jim

kenfused

12:59 am on Jul 6, 2005 (gmt 0)

10+ Year Member



Hi jd,

I tried doing the same thing, by putting your code in an .htaccess file in a direcetory, but then I only get a 403 Forbidden error saying I don't have permission to view the files.

Any ideas?

I put the .htaccess file in a folder [mysite.com...]

Addendum: Duh, I forgot to turn rewriteengin On!