简体   繁体   中英

Rewrite rule of iis is not working

I want to make a redirection like that:

localhost:80/api/* to localhost:8080/api/*

I'm trying to use iis to do this task but is not working, the rule that i have used is :

(Pattern)(RE) ^api/(.*) (Action)(Rewrite) http://localhost:8080/ {R:1}

https://i.stack.imgur.com/6svRA.png

How can it be done?

Your rule looks correct. I think the problem that you don't have ARR installed/enabled. Please follow this steps:

1) You need to install ARR module for IIS

2) Enable ARR. On the Application Request Routing page, select Enable proxy

3) Restart IIS and check that your rewrite rule is working

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