web.config将物理文件夹名称附加到重定向的URL的末尾

时间:2013-10-02 03:38:59

标签: asp.net redirect

网络解决方案(NetSol从现在开始)有一个名为BlogEngine.NET的开源软件包,它们提供的版本是2.5。你可以看到它在我的服务器上使用这个地址:www.daleallen.net/blog25你会注意到它出现就好了。它安装在的物理文件夹是NetSol控制面板中的www \ blog25。

但是当使用http://blog25.daleallen.net的新网址将NetSol指针配置为指向同一个物理文件夹时,页面看起来都搞砸了。然后,当我检查超链接的属性时,它会显示http://blog25.daleallen.net/BLOG25,这意味着它将物理文件夹名称添加到URL的末尾,搞砸了页面和图像文件夹的路径。

NetSol为重定向创建了一个web.config文件,并将其安装在我的共享主机软件包的根目录下。我被告知他们在Windows 2008 Server上使用IIS 7。

有人能告诉我他们做错了什么,即将物理文件夹的名称添加到重定向的URL的末尾?请参阅下面的web.config文件的内容...

 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule platformId="wdpVpr" name="blog25.daleallen.net virtual path rewrite"      stopProcessing="true">
                <match url="^.*$" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^blog25\.daleallen\.net$" />
                </conditions>
                <action type="Rewrite" url="/blog25/{R:0}" appendQueryString="true" />
            </rule>
            <rule platformId="wdpVpr" name="www.bananapages.net virtual path rewrite" stopProcessing="true">
                <match url="^.*$" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^www\.bananapages\.net$" />
                </conditions>
                <action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
            </rule>
            <rule platformId="wdpVpr" name="bananapages.net virtual path rewrite" stopProcessing="true">
                <match url="^.*$" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^bananapages\.net$" />
                </conditions>
                <action type="Rewrite" url="/bp/{R:0}" appendQueryString="true" />
            </rule>
            <rule platformId="wdpVpr" name="blog.daleallen.net virtual path rewrite" stopProcessing="true">
                <match url="^.*$" ignoreCase="false" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^blog\.daleallen\.net$" />
                </conditions>
                <action type="Rewrite" url="/blog/{R:0}" appendQueryString="true" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="blog25.daleallen.net virtual path rewrite">
                <match serverVariable="RESPONSE_LOCATION" pattern="^(https?\://blog25\.daleallen\.net)/blog25/(.+/)$" />
                <conditions>
                    <add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" value="{R:1}/{R:2}" />
            </rule>
            <rule name="www.bananapages.net virtual path rewrite">
                <match serverVariable="RESPONSE_LOCATION" pattern="^(https?\://www\.bananapages\.net)/bp/(.+/)$" />
                <conditions>
                    <add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" value="{R:1}/{R:2}" />
            </rule>
            <rule name="bananapages.net virtual path rewrite">
                <match serverVariable="RESPONSE_LOCATION" pattern="^(https?\://bananapages\.net)/bp/(.+/)$" />
                <conditions>
                    <add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" value="{R:1}/{R:2}" />
            </rule>
            <rule name="blog.daleallen.net virtual path rewrite">
                <match serverVariable="RESPONSE_LOCATION" pattern="^(https?\://blog\.daleallen\.net)/blog/(.+/)$" />
                <conditions>
                    <add input="{RESPONSE_STATUS}" pattern="^301$" ignoreCase="false" />
                </conditions>
                <action type="Rewrite" value="{R:1}/{R:2}" />
            </rule>
        </outboundRules>
    </rewrite>
    </system.webServer>
</configuration>

0 个答案:

没有答案