简体   繁体   中英

Adding a "?" using IIS URL Rewrite

I need to create an URL rewrite so that when the users type: mydomain.com/test123 the server gets: mydomain.com/?test123.

I tried this:

<rule name="UF" stopProcessing="true"> <match url="example.com/([_0-9a-z-]+)" /> <action type="Redirect" url="https://example.com/?{R:1}" /> </rule>

According to your description, I suggest you could try to use below url rewrite rule.

            <rule name="UF" stopProcessing="true">
                <match url="([_0-9a-z-]+)" />
                <action type="Redirect" url="https://example.com/?{R:1}" appendQueryString="false" />
            </rule>

Result:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM