tags:

views:

49

answers:

1

Hi,

I am new to IIS7. I got a problem with the default document for a website. I have the default document enabled and the default document was set to home.aspx but when I browse the site using only http://mysite.com, I got the

403 - Forbidden: Access is denied

error. It works fine when I use the URL with the name of the file like this: http://mysite.com/home.aspx.

Any help is greatly appreciated.

John

+1  A: 

Take a look in the web.config file - double check that the defaultDocument section is correctly set up.

Post it here if you're unsure

stupid-phil
Here it is:<system.webServer> <defaultDocument enabled="true"> <files> <add value="SeachByAddress.aspx" /> </files> </defaultDocument> </system.webServer>
John
Your default doc isn't set to home.aspx there- is that the correct file? Also there are usually some 'remove' tags in there depending on whether there are default dogs set at the server level.
stupid-phil
Sorry. the Home.aspx file I used in my question was not really the name of the default document. It was used only as an example. SeachByAddress.aspx is actually the name of the default document.
John
Are there any default docs defined at the server level - you'd normally see some remove tags in there... Not sure that's the issue though - is that filename correct? Shouldnt it be 'SearchByAddress.aspx' are you missing an 'r'?
stupid-phil
Thanks again.I am sorry for all the confusion and misleading that the name of the file for the default document has caused.The file name of the default document is not the issue. It is correct. I should have simply copied and pasted the name.
John
Lol - ok, is there any more detail on the error in the IIS log. Also maybe use Fiddler2 to look at the full details being returned to the browser.
stupid-phil
Update:I found out there are a couple of default documents that were inherited from higher level sites. Since I could not think of another reason why it was not working, I removed all but one inherited default docs. Guess what? That made it work! I am not sure why but it certainly is something interesting to look into.
John
Excellent. Glad it's fixed.
stupid-phil
Now that the default document problem is resolved, a different but related problem came up.We have a couple of web sites (not virtual directories) that were migrated from IIS6 where each of them points to the same set of source code, each with its own default page. They were all working fine in IIS6.After they were migrated to IIS7, they now each share the same web.config where the default documents are configured.In this case all of them use the same default document. How to configure a different default doc for each site?Is it even possible to retain our original setting in IIS6?
John
You can only have one set of default docs in one web config. You may be able to add a web config in each directory and add the appropriate default docs in them.
stupid-phil
That is what I suspected. Our main purpose is to share the same source code. It is really one application with a couple of different features. Each website corresponds to one feature. Given this situation, what would you recommend?
John