在具有+的IIS中重写URL(Rewriting URLS in IIS having +)

编程入门 行业动态 更新时间:2024-10-23 02:07:15
在具有+的IIS中重写URL(Rewriting URLS in IIS having +)

我有以下网址 - website.com/ABCDETest+PHP,每次访问该网站时,我都会收到404 - 找不到文件或目录。 我的web.config是

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Test" patternSyntax="Wildcard"> <match url="*"/> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> </conditions> <action type="Rewrite" url="index.php"/> </rule> </rules> </rewrite> </system.webServer>

有没有人碰巧知道为什么我得到404页面而且它没有重定向到index.php?

I have the following URL - website.com/ABCDETest+PHP, and every time I access the website I get 404 - File or directory not found. My web.config is

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Test" patternSyntax="Wildcard"> <match url="*"/> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> </conditions> <action type="Rewrite" url="index.php"/> </rule> </rules> </rewrite> </system.webServer>

Does anyone happen to know why I am getting the 404 page and it is not redirecting to the index.php?

最满意答案

您可能收到HTTP错误404.11 - 未找到

这不是因为规则不起作用,而是因为与请求过滤模块拒绝请求的安全性相关。

请求过滤模块被配置为拒绝包含双转义序列的请求。

你必须做以下

IIS管理器 - >查找网站>转到请求过滤 - >编辑功能设置并启用设置“允许双重转义”。

允许在IIS请求过滤模块中进行双重转义

You may be getting HTTP Error 404.11 - Not Found

This is not because the rule did not work but because of security related where request filtering module is denying the request.

The request filtering module is configured to deny a request that contains a double escape sequence.

You have to do following

IIS manager ->Find the Website >Go to the Request Filtering ->Edit Feature Settings and enable setting "Allow double escaping" .

allow double escaping in IIS request filtering module

更多推荐

webServer>,电脑培训,计算机培训,IT培训"/> <meta name="description&quo

本文发布于:2023-08-07 02:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1458902.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   IIS   URL   URLS   Rewriting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!