且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在PHP中的web.config中重写查询字符串url

更新时间:2022-11-05 07:51:18

我使用下面的代码

<rule name="Redirect to url" stopProcessing="true">
    <match url=".*" />
        <conditions>
        <add input="{HTTP_HOST}" pattern="^page-name/([^/]+)/?$" />
            </conditions>
        <action type="Redirect" url="page-name/?id={R:0}" redirectType="Permanent" />
 </rule>

但如果我使用此代码,我将收到404错误。这段代码有什么问题?

but I am getting 404 Error if I use this code. what is the problem in this code?