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
2010-09-02 03:26:59
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
2010-09-02 18:03:22
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
2010-09-02 18:39:35