Link to home
Start Free TrialLog in
Avatar of bleggee
bleggeeFlag for United States of America

asked on

How code a 301 redirect for folder files -> 1 file

Can anyone help me with the code for a 301 redirect (via apache/htaccess) for this situation:
An entire folder of HTML docs no longer exists ... let's call it /example.com/school/ and the file names that were in that 'school' folder are unknown. So if anyone clicks a link somewhere that points to http://example.com/school/<anything> I want to permanently (301) redirect them to a single file in the same domain /example.com/classrooms.htm

Hope that makes sense, but an example just in case:
http://example.com/school/foobar/room1.htm          should redirect to http://example.com/classrooms.htm
http://example.com/school/room1.html                      should redirect to http://example.com/classrooms.htm
http://example.com/school/room77hi.html                should redirect to http://example.com/classrooms.htm   
etc
ASKER CERTIFIED SOLUTION
Avatar of DonConsolio
DonConsolio
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bleggee

ASKER

Worked perfectly! Thank you.