在地址栏中显示默认文档路径 [英] Show default document path in address bar

查看:76
本文介绍了在地址栏中显示默认文档路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我将一个默认文档添加到web.config中,如下所示

hi I add a default document to web.config like bellow

<defaultDocument>
      <files>
        <add value="folder1/Default.aspx" />
      </files>
    </defaultDocument>



工作正常,但我想在地址栏中显示完整路径。目前网址是



www.mydomain.com

但我想在地址栏中

www.mydomain.com/folder1/Default.aspx



还有其他文件夹还有folder2,folder3等......每个文件夹都包含一个Default.aspx

所以当用户输入www.mydomain.com/folder2并输入我想要的时候自动重定向到www.mydomain.com/folder2/Default.aspx和地址栏中可见的网址。


its working fine but I want to show the full path in address bar.currently the URL is

www.mydomain.com
but I want in address bar
www.mydomain.com/folder1/Default.aspx

also there are other folder also folder2,folder3 etc..and each folder contains a Default.aspx
so when user type www.mydomain.com/folder2 and enter I want they automatically redirect to www.mydomain.com/folder2/Default.aspx and the url visible in address bar.

推荐答案

没有意义。根据定义,默认文档是当用户键入域名或IP地址的URL时要加载到网页上的文档,或者某些引用者链接此类URL。每个目录也可以有这样的默认文件。



你应该明白:你并没有真正控制地址栏。用户编写他们想要的URI,或者某些其他文档中的链接(锚点)定义要放在HTTP请求中的URI。您可以在其他文档的锚点(或重定向或类似的东西)中编写您想要的完整URI,此URI将显示在地址栏中。但这没有任何意义。



-SA
It makes no sense. Default document is, by definition, a document to be loaded on a Web page when a user types the URL of the domain name or IP address, or some referrer links such URL. Every directory can also have such default document.

You should understand: you are not really controlling address bar. The users write the URIs they want, or the links (anchors) in some other document define the URI to be placed in HTTP request. You can write the "full" URI you wanted in the anchor of some other document (or redirect, or anything like that), and this URI will be shown in the address bar. But it makes no sense.

—SA


这篇关于在地址栏中显示默认文档路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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