IIS重定向到错误的URL路径 [英] IIS redirecting to wrong URL Path

查看:102
本文介绍了IIS重定向到错误的URL路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IIS中浏览我的代码时,我的URL路径不正确如下:

http://localhost/example/default.aspx?ReturnUrl =%2fexample

当我从这个URL记录时,它将重定向到URL为http:// localhost / example的同一页面。我必须重定向到我的default.aspx页面,所以任何人都建议我。

我需要在我的web cofig文件中进行任何更改。

When browsing my code in IIS i'm getting incorrect URL Path like :
http://localhost/example/default.aspx?ReturnUrl=%2fexample
and when im logging from this url it is redirecting to same page with URL http://localhost/example. I have to redirect to my default.aspx page so any one suggest me.
do i need to make any changes in my web cofig file.

推荐答案

Here it is. Add this code to your web.config file:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="Root Hit Redirect" stopProcessing="true">
                <match url="^


/ >
< action type = 重定向 url = / menu_1 / MainScreen.aspx / >
< / rule >
< / rules >
< / rewrite >
< / system.webServer >
" /> <action type="Redirect" url="/menu_1/MainScreen.aspx" /> </rule> </rules> </rewrite> </system.webServer>







我得到了我的解决方案谢谢。




I got my solution Thank You.


这篇关于IIS重定向到错误的URL路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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