简体   繁体   English

在IIS上将子域重写为子文件夹

[英]Rewrite subdomain as subfolder on IIS

I'm trying to use content hosted on a subdomain site as a sobfolder on same domain. 我正在尝试将托管在子域网站上的内容用作同一域上的sobfolder。 (On different servers) (在不同的服务器上)

mydomain.com -> is main domain. mydomain.com - >是主域名。 sub.mydomain.com -> is sub domain. sub.mydomain.com - >是子域名。

mydomain.com/sub -> is what I want to show my sub domain content on. mydomain.com/sub - >是我想要显示我的子域内容的。

on my main domain, I changed Application Request Routing as "enable proxy" and used code below, on the web.config 在我的主域上,我将应用程序请求路由更改为“启用代理”并在web.config上使用下面的代码

<rewrite>
    <rules>
        <rule name="Reverse Proxy to fuarlar" stopProcessing="true">
            <match url="^sub/(.*)" />
            <action type="Rewrite" url="http://sub.mydomain.com/{R:1}" />
        </rule>
    </rules>
</rewrite>

But It didn't work. 但它没有用。 (on www.mydomain.com/sub gives me an error that '404 not found') (在www.mydomain.com/sub上给我一个'404 not found'的错误)

What should I make for that? 我应该为此做些什么? Whats wrong with my configuration? 我的配置有什么问题?

What should my steps be? 我的步骤应该是什么?

www.mydomain.com/sub does not match ^sub/(.*). www.mydomain.com/sub与^ sub /(.*)不匹配。 You are missing a slash at the end of your URL. 您在网址末尾缺少斜杠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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