Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So I have a website running on a discount asp.net account, and I put an asp.net mvc app in a subdirectory. If my url is 'www.website.com' and my app is in directory 'sample', then 'www.website.com/sample' will execute the mvc app.

My problem is that I want the app to be shown when you go to 'www.website.com' not just 'www.website.com/sample'. I have access to the IIS Manager, and I'm sure there are many ways to do this.

What's the best way to do this?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

You need to configure HTTP Redirection on the web site. Make sure that the HTTP Redirection role service of the Web Server role is installed. Once that's done you can select your site in IIS Manager and double click the HTTP Redirect icon in the IIS area of the features view to configure redirection. (Sounds complicated, huh) - ;)

share|improve this answer
add comment

Just set

  <clear />
  <add value="Candidate/Login.aspx" />
  </files>
</defaultDocument>

in Web.config file and put all files not with in a subfolder so that user can type Url only instead of Url/subfolder....

Here clear is the main thing to be done which will clear all other default docs with in IIS ...

share|improve this answer
add comment

Unless you have other subdirectories that need to be relative to the webroot, you should be able to simply point the root of the website (either a defined website for that host header, or the default site) to the sample directory.

share|improve this answer
add comment

If I am not mistaking, you can just change the path for the website (not the virtual directory), so that the website points directly to the root folder.

In general, lets assume your website follows the following heirarchy:

d:\Root\Sample

So, if you point the website to D:\Root, then you will have a folder named Sample listed as a folder under your website. If you make it to point d:\Root\Sample, then it should be displaying the inner files/folders of your sample folder.

I am unsure if you want to change the settings for your default website. If this is the only website you are going to host, then you might as well make it. Your IIS default folder will no longer be c:\inetpub\wwwroot - which usually has most of the configurations done beforehand to let any webpage placed here such as handling the access permissions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.