阿帕奇RedirectMatch,的ErrorDocument .etc不会为用unsual查询字符串工作 [英] Apache RedirectMatch, ErrorDocument .etc doesn't work for the unsual query string
问题描述
www.mysite.com/something.do?name=%25'%20and%201=1%20 -
www.mysite.com/something.do?name=%25'%20and%201=1%20--
此网址包含安全测试一个不同寻常的查询字符串。
This url contains an unusual query string for security test.
阿帕奇显示其默认的错误页面: 400错误的请求
Apache shows its default error page : 400 Bad Request
.
不过,我需要证明我自己的错误页面。
But I need to show my own error page.
我试过几件事情但都失败了,不断显示默认的Apache错误。
I tried several things but all failed, keeps showing apache default error.
1
的ErrorDocument 400 / myErrorPage
ErrorDocument 400 /myErrorPage
2
RedirectMatch - $ / myErrorPage
RedirectMatch --$ /myErrorPage
3。
RewriteEngine叙述在结果
重写规则 - $ / myErrorPage
RewriteEngine On
RewriteRule --$ /myErrorPage
4
RewriteEngine叙述在
RewriteEngine On
的RewriteCond%{} THE_REQUEST - $
RewriteCond %{THE_REQUEST} --$
重写规则^(。*)$ / myErrorPage
RewriteRule ^(.*)$ /myErrorPage
我的Apache的版本是:服务器版本:阿帕奇/ 2.2.12(的Linux / SUSE)
My apache version is : Server version: Apache/2.2.12 (Linux/SUSE)
.
我该如何处理这种用unsual请求URL?
How can I handle this unsual request url?
推荐答案
尝试使用一个完整的URL或在您的ErrorDocument参数的静态字符串,这些有时更可用,当原来的请求是不好的,因为它们不需要被通过服务器的正常请求处理服
Try using either a full URL or a static string in your ErrorDocument argument, those are sometimes more usable when the original request is bad because they don't require being served through the normal request processing of the server.
这篇关于阿帕奇RedirectMatch,的ErrorDocument .etc不会为用unsual查询字符串工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!