Topic: How can I change default pages?

Hey guys,

Never used .NET, but I have a site where I want to upload an 'index.html' file in the same root directory as 'default.aspx'. The browser defaults to the 'default.aspx', but I want it to see 'index.html' as the default page. I think there's something _similar_ to .htaccess in Windows servers, but can't figure it out. I've gotten as far as thinking that it has to do with something called IIS Services (6.0? I dunno), but can't find where this change needs to be made.

Any suggestions? Thanks,

Ben

Re: How can I change default pages?

In Visual Studio 2005 Pro

A few ways of doing this:

1. Right click on your index.html in the Solution Exporer (F3) and choose "Set as Start Page"

2. Right click on your solution -- the top-most item in the Solution Explorer (F3) and go to Property Pages.  In the new dialog window, select Start Options on the left.  On the right, You can choose your start page/url.

3.  Your defalut.aspx page is VERY similar to a HTML page, including the <html>, <head>, and <body> tags.  So, you could just move all your HTML code into your ASPX page.

Re: How can I change default pages?

I know there's a way you can set it in IIS. I haven't played with IIS in a while but as I recall there's a control panel where you can set the precedance that the server looks for default pages. By default it's set to .ASP, then .HTML, .HTM, etc. If you move .HTML to the top of the list it will load that by default: http://orcmid.com/centrale/web/iis/c030400.htm

I can't remember where you access the properties for this and I can't check because I'm at work and they won't let me install IIS on this box, but I believe it's in the properties of whichever virtual server you are working on within the IIS administrator thinger (control panel -> Administrative tools -> Services -> Internet Information Services )

just found this, it might help: http://drupal.org/node/44093

good luck!
-Rhino

Lord, give us the wisdom to utter words that are gentle and tender, for tomorrow we may have to eat them.   -Rep. Morris Udall

Re: How can I change default pages?

Hrm, ok. Let me contextualize this scenario a bit. Company A's IT guy runs the server which their company site is on. IT guy isn't happy that we're doing his company's website (though his higher-ups ordered it so). We want to leave all the files that they have in tact on their server, and add ours (which has the index.html) file. What do we tell Company A's IT guy to do in order to get it to default to index.html? I'm not sure if he uses ISS or has Visual Studio 2005 Pro.

Is there an answer to that question or would I need to find out how he runs things on the server?

Re: How can I change default pages?

the plot thickens smile Most likely the answer to that question is going to be dependant on how his server is set up. I don't know the steps he would take to do it but I think basically what he needs to do is set the precedence of .HTML pages to be higher than that of .ASP pages. That way if no page is specified the server will look in the root directory for an .HTML page first and if it finds one it will load it and stop looking; if not it will look for .ASP docs. Right now it would be set to look for .ASP pages first as they have a higher precedence by default.

Again, the exact steps to make this happen would depend on his setup but any halfway competant sysadmin should know how to do this...if he says he doesn't know he's probably sandbagging (in my experience). Either way it should be in his server help files.

-Rhino

Last edited by Rhino (2007-07-13 09:39:02)

Lord, give us the wisdom to utter words that are gentle and tender, for tomorrow we may have to eat them.   -Rep. Morris Udall

Re: How can I change default pages?

If at all possible, I'd recommend or at the least put into writing for the client that execution of the website is dependant upon the web host cooperating fully and that a new web host may be likely in the case that there are delays or problems.

I normally build a site out on a dev server normally reachable by ip address, or subdomain (somename.mydomain.com) and point the client to that first, then when its time to launch move the site to the main server.

In any case, in the IIS Manager, here are the steps for  a windows Server 2003 :

1) Login with rights to change the server configurations
2) Start > All Programs > Administrative Tools > Internet Information Services (IIS) Manager
3) In the left hand column of the IIS manager, expand the + next to your server name .
4) Expand the + next to the folder 'Web Sites'
5) Locate the site in the list.
6) right click and select properties
7) in the properties dialog box that opens select the 'Documents' tab
8) place index.html as the top document in the list, if it isn't in the list click 'Add' and add it to the list. Its important that it is first in the list as the webserver will look for documents in the order of this list.

9) Apply button, Ok button...
10) for safe measure, restart the site process by right clicking and selecting stop, then right click and start again

that should do it...

Re: How can I change default pages?

richards wrote:

If at all possible, I'd recommend or at the least put into writing for the client that execution of the website is dependant upon the web host cooperating fully and that a new web host may be likely in the case that there are delays or problems.

very wise advice here. I learned the hard way to always CYA (Cover Your Butt). It wouldn't be suprising to see the IT guy be unable or unwilling to get your page running and then come back at you saying your code broke his server or something along those lines, especially if he is against you in the first place. Getting that disclaimer in writing could possibly save you a lot of grief later on.

Last edited by Rhino (2007-07-13 10:29:06)

Lord, give us the wisdom to utter words that are gentle and tender, for tomorrow we may have to eat them.   -Rep. Morris Udall

Re: How can I change default pages?

Thanks for the advice guys. Turns out he doesn't host the site, some other company does. I was told wrong! Either way he said he's working on it, so we'll hope that he follows through.

Thanks again.

Re: How can I change default pages?

maybe you could get the name of the hosting company and call them yourself? who knows what he's going to say to or ask them...

protect your neck. always.

Last edited by Rhino (2007-07-13 10:54:16)

Lord, give us the wisdom to utter words that are gentle and tender, for tomorrow we may have to eat them.   -Rep. Morris Udall