大家好,就我而言,我拥有的 web.config 文件会重写 url,以便显示http://www.site.com/page.php而不是显示http://www.site.com /page现在 GET 函数将不起作用。
这是web.config的代码:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="^(.*)\.htm$" />
<action type="Rewrite" url="{R:1}.php" />
</rule>
<rule name="Imported Rule 4">
<match url="^(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?page={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="^([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
关于如何允许 PHP $_GET 函数的任何想法?
编辑:通过将 appendQueryString="false" 更改为 appendQueryString="true" 进行修复 感谢您的帮助!