重定向下面的子目录中的所有链接"停止服务&QUOT的;页? [英] Redirect all links below a subdirectory to a "out of service" page?

查看:101
本文介绍了重定向下面的子目录中的所有链接"停止服务&QUOT的;页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完整的电子邮件的形式在不同的子目录里,由不同的人在不同的地方链接的目录。我最近发现了一些形式的安全问题,而我所有脱机他们,但现在当人去联系他们得到404错误。有没有一种简单的方法,用的.htaccess也许,重定向mydomain.com/mydirectory/*到mydomain.com/outofservice.html~~V任何要求吗?

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?

推荐答案

这是完全可能的。htaccess的。

This is absolutely possible with .htaccess.

RewriteEngine On
RewriteBase /
RewriteRule ^mydirectory.*$ /outofservice.html [R]

这篇关于重定向下面的子目录中的所有链接"停止服务&QUOT的;页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆