Azure的网站 - URL重写使用web.config中不工作 [英] Azure web site - URL Rewrite using web.config not working

查看:317
本文介绍了Azure的网站 - URL重写使用web.config中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都到Azure的迁移一些网站,我把它设置为一个网站。

We are migrating some sites over to Azure and I have it setup as a "Web Site".

什么,我们正在试图做的一个例子是pretty直线前进。

An example of what we're trying to do is pretty straight forward.

当前网址: http://www.website.com/Products.aspx
清洁网址: http://www.website.com/Products/

所以在web.config中,有以下内容:

So in the web.config, there is the following:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="ProductList">
                <match url="/Products.aspx" />
                <action type="Redirect" url="/Products" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

这是在IIS中产生的。我试图设置stopProcess属性设置为true ... ...这是我在几个线程已经看到了解决方案,但没有什么工作。

This was generated in IIS. I have tried to set the stopProcess attribute to true... which is a solution that I've seen in a few threads, but nothing is working.

这网站是用来重写一个ISAPI模块,我们原有的网站之一。由于我们不使用Azure的VM,我们不能继续使用这种方法改写。

This website is one of our legacy sites that uses an ISAPI module for Rewrites. Since we aren't using an Azure VM, we cannot continue using this method to rewrite.

有我丢失的东西在这里?

Is there something I'm missing here?

推荐答案

Azure网站没有安装URL重写模块,这样的配置方式是行不通的。也许你可以更新站点code使用ASP.NET URL路由,如由斯科特谷这个博客帖子描述:<一href=\"http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx\" rel=\"nofollow\">http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx

Azure网站没有使用安装重写模块的网址,但现在这样做,所以你可以使用标准的&LT; system.webServer&GT;&LT;改写&GT; web.config部分,

Azure Web Sites didn't used to have the URL Rewrite Module installed, but now it does, so you can just use the standard <system.webServer><rewrite> section in your web.config.

这篇关于Azure的网站 - URL重写使用web.config中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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