views:

22

answers:

1

I have a directory full of email forms in various subdirectories, linked by various people in various places. I recently found a security problem in some of the forms, and I've taken them all offline, but now when people go to the links they get 404 errors. Is there an easy way, with .htaccess perhaps, to redirect any request for mydomain.com/mydirectory/* to mydomain.com/outofservice.html?

+1  A: 

This is absolutely possible with .htaccess.

RewriteEngine On
RewriteBase /
RewriteRule ^mydirectory.*$ /outofservice.html [R]
Fraxtil
Cool, but where do i save that? In the root of mydirectory, or the root of the domain?Edit: Tried both, won't work.
Mike Turley
Messed around a bit and got it to work. I had to use two different .htaccess files, one in the root and one in mydirectory, with the matching regexes ^mydirectory.*$ and ^.*$ respectively.
Mike Turley