Rewrite query string url in web.config in PHP

时光怂恿深爱的人放手 提交于 2019-12-10 20:29:12

问题


I want to redirect url From http://example.com/page-name/?id=45 to http://example.com/page-name/45 in web.config in IIS. How can I write it's rule for web.config?


回答1:


I am using below code

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

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



来源:https://stackoverflow.com/questions/27357271/rewrite-query-string-url-in-web-config-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!