Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi I add a default document to web.config like bellow
XML
<defaultDocument>
      <files>
        <add value="folder1/Default.aspx" />
      </files>
    </defaultDocument>

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.
Posted

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900