2017-05-26 140 views
0

我有以下URL - website.com/ABCDETest+PHP,我每次访问该网站时,我得到404 - 未找到文件或目录。我的web.config是在IIS重写URL为+

<?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?

回答

1

你可能会得到HTTP错误404.11 - 找不到

这不是因为规则没有工作,但在那里请求过滤模块拒绝该请求,因为安全相关。

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

你必须做以下

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

allow double escaping in IIS request filtering module

+0

谢谢!这对我有效。 – Ratty