• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

Redirecting with .htaccess

jgbishop

Senior member
May 29, 2003
521
0
0
I have some files at a website that I no longer offer (they have been obsoleted). I'd like to be able to redirect these files to the top page at my website. Ideally, I would like to use a rule that handles any file in a subfolder. For example:

I'd like to redirect anything under www.mydomain.com/myfolder/ to www.mydomain.com/index.html. What kind of rule do I use in my .htaccess file to do such a thing? I'm currently using the following rule:

Redirect /myfolder/ http://www.mydomain.com/

This has the affect of redirecting a page like www.mydomain.com/myfolder/mypage.html to www.mydomain.com/mypage.html (instead of the top page, like I would like).

Any help would be appreciated.