【问题标题】:PHP Web site cannot run properly on IISPHP 网站无法在 IIS 上正常运行
【发布时间】:2018-06-19 14:35:07
【问题描述】:

我们运行一个主站点,并希望在 /tesmer 文件夹下运行第二个站点。在演示站点上它运行良好。当我在 Windows 服务器上上传它时, /tesmer/ 显示正确。任何喜欢 /tesmer/smmm-sinav-islemleri 的子页面都有 404 错误。

我们使用Url rewrite,在IIS下好像url rewrite有问题。

开发站点下的工作页面: http://demo.dijitall.net/izsm/tesmer/smmm-sinav-islemleri

IIS / Windows Server 2016 上的非工作页面 http://yeni.izsmmmo.org.tr/tesmer/smmm-sinav-islemleri

下面是 /tesmer 文件夹中的 web.config 文件

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 10">
                    <match url="^([0-9a-zA-Z-_/]+)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php?par={R:1}" appendQueryString="false" />
                </rule>
                <rule name="Imported Rule 20" stopProcessing="true">
                    <match url="^resimmap.xml$" ignoreCase="false" />
                    <action type="Rewrite" url="resimmap.php" />
                </rule>
            </rules>
        </rewrite>
        <httpErrors errorMode="Detailed" />
    </system.webServer>
</configuration>

解决办法是什么?正确的 url 写入规则或其他内容?

【问题讨论】:

    标签: php iis url-rewriting


    【解决方案1】:

    我已添加该规则:

    <rule name="tesmer22" stopProcessing="true">
    
      <match url="^tesmer/([0-9a-zA-Z-_/]+)$" ignoreCase="false" />
        <conditions logicalGrouping="MatchAll">
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        </conditions>
    
      <action type="Rewrite" url="tesmer\index.php?par={R:1}" />        
    
    </rule>   
    

    【讨论】:

      猜你喜欢
      • 2021-08-18
      • 2018-05-11
      • 2015-08-30
      • 1970-01-01
      • 2017-12-01
      • 2017-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多