bleggee
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.ht m
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
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.ht
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER