重写iis规则不起作用 [英] Rewrite rule of iis is not working

查看:378
本文介绍了重写iis规则不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行这样的重定向:

I want to make a redirection like that:

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

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

我正在尝试使用iis来执行此任务但是无法正常工作,我使用
的规则是:

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

(模式)(RE)^ api /(.*)
(动作)(重写) http:// localhost: 8080 / {R:1}

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

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

怎么办?

推荐答案

您的规则看起来是正确的。我认为您没有安装/启用ARR的问题。请按照以下步骤操作:

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

1)您需要安装 ARR模块

2)启用ARR。在应用程序请求路由页面上,选择启用代理

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

3)重新启动IIS并检查您的重写规则是否正常工作

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

这篇关于重写iis规则不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆