1

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

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

NetSol 为重定向创建一个 web.config 文件并将其安装在我的共享主机包的根目录中。我被告知他们在 Windows 2008 服务器上使用 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>
4

0 回答 0