php - PHP 网站无法在 IIS 上正常运行
问题描述
我们运行一个主站点,并希望在 /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 写入规则或其他内容?
解决方案
我已经添加了该规则:
<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>
推荐阅读
- python - 如何在 django 中动态添加选择字段中的选项?
- c++ - 如果我在 Linux 上更改 C++ 动态共享库而我的可执行程序在它上面使用会发生什么
- visual-studio-code - 突出显示的缩进指南 VS CODE
- azure - 动态处理elasticsearch中的空日期
- r - 如何从data.frame中读取识别数字对的索引?
- c - 如何修改文件中的内容?
- python - How to compare Scalar to Float
- image - 盖茨比不向公众构建图像
- jquery - 文件未在 Ajax 调用的 Asp.Net MVC 中下载
- kotlin - Kotlin fun() 与 lambda 有区别吗?