Friday, April 15, 2011

opening a default index.html file inside a folder (asp.net)

I'm a real noob when it comes to asp.net/html. I'm developing a very basic web site using VS 2008. At this point it's mostly just html pages - no real ASP.NET

I have a root index.html and then a set of folders like css/ images/ features/

etc. and index.html files inside them, so one can access it as

http://www.blahblah.com/features and the index.html opens (it happens on my 1&1 basic web hoster)

But I can't test this locally because when the VS default web server opens my page for test, if I give /features

it shows the directory listing. I want it to open the index.html inside it...can't figure out how to make these friendly URL's WITHOUT USING ASP.NET core features (it's important - I don't plan to use ASP.NET for now)

any suggestion is welcome - all I want is a way to test it before upload to web site

From stackoverflow
  • Thats a behavior I've seen before with the Development web server and something similar with IIS ( in that case you usually get a 403- denied).

    unlike the default configuration for many other web servers the 'default page' for IIS is default.aspx. In IIS you can configure the default page

    (Right click on your virtual directory select Properties then on the Documents tab you have the option to add/edit default content pages for your site)

    but I don't know if a way of doing it for the Visual Studio Development web server.

    For your scenario if you take your index.html files and rename them to default.aspx ( you do not need to change their content) you should see your 'index' page instead of the directory listing.

  • The default file for Cassini (The VS Server) is default.aspx, or the currently selected .aspx file when you click "Run". As far as I know there isn't any way to easily customize the "Default Document" as running in Cassini.

    If you are not looking to use ASP.NET and want a simple workaround. Setup your site in IIS, and view items that way.

  • I hate you. Honestly.

0 comments:

Post a Comment