-1

I have asp.net (web forms) website where I have different pages in supplier & customer folders. ex. localhost/supplier/index.aspx & localhost/customer/index.aspx . If someone tries to open "localhost/supplier" he would get error.Is there a way to route the links to their respective index pages?

2 Answers2

0

I believe you need to set in the web config the default document

<defaultDocument enabled="true">    <!-- this line enables default documents for a directory -->
   <files>      
       <clear/>     <!-- removes the existing default document list -->                
       <add value="foo.htm"/>     <!-- foo.htm is now the default document  -->                
       <add value="foo.php"/>     <!-- 2nd default document in search order -->                
       <add value="foo.aspx/>     <!-- 3rd default document in search order -->                
       <add value="foo.cfm/>      <!-- 4th default document in search order -->
   </files>
</defaultDocument>

The default document is returned to the client when the browser requests a directory name (foo.com/, foo.com/somedir/), but doesn't specify a page.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
horHAY
  • 788
  • 2
  • 10
  • 23
0

disable directory browsing in IIS

ThePravinDeshmukh
  • 1,823
  • 12
  • 21