1

I have an asp net project with name: DocCat , same name of application in IIS. When i open my asp net application from visual studio(iis express) it has path like this:
http://localhost:49727/Pages/Main.aspx

But when i want to open it in IIS i have this path :
http://localhost:49727/DocCat/
and it open only folders , not my startup page. I need to rename start page path of my web application in IIS, to http://localhost:49727/Pages/Main.aspx
what can i do for this?

I tried :

1) Add this code to Webcongif file :

  <system.webServer>
        <defaultDocument>
            <files>
              <add  value="Pages/Main.aspx" />
            </files>
        </defaultDocument>
    </system.webServer>     

2)Set default document to Main.aspx or Pages/Main.aspx
3) Add virtual catalogue with virtual path Pages/Main.aspx and physical path : BigCar/BigCar/Pages
How can i rename startup path in IIS?

Edit. Suggested question didn't solve my problem - because startuo page in IIS open FOLDER , not the page - likle this :
http://imgur.com/a/O5XGJ

  • Possible duplicate of [asp.net site default document in subfolder](http://stackoverflow.com/questions/421778/asp-net-site-default-document-in-subfolder) – ThatChris Oct 27 '16 at 08:57
  • @ChristopherTrevor no duplicates, read my edit plz – Андрей Голубцов Oct 27 '16 at 09:10
  • Your files dont seem to have actually been published, but rather that they are the raw source files. In Visual Studio did you right click and publish? You will then need to copy the resulting files from there to your site directory. Then follow the advice given on the previous link. – ThatChris Oct 27 '16 at 09:13
  • are you adding right directory in IIS? i think you need to add one more level of directory means DOCCAT which is shown in folder. please try to remap path to this directory and see whether it is working? – Rajput Oct 27 '16 at 09:20
  • @ChristopherTrevor Yep, my project wasn't published , i add default document and now path is right, but i have error that my page wasn't found , but physical path is right and i can open this file in studio – Андрей Голубцов Oct 27 '16 at 09:42
  • If you have a look at the link from earlier, you need to have a document in the root that can serve as a default document. So either you need to move main.aspx out of the pages folder or you need to add a default.aspx page in the root and in the page load of that page redirect to main.aspx. I would normally leave my login page in the root and use that as the default document. – ThatChris Oct 27 '16 at 10:26
  • I have undeleted my original answer below. I will edit it to include the answers from the comments. If this answer helps you please mark as correct. – ThatChris Oct 27 '16 at 10:29

3 Answers3

1

If you browse to your site in IIS, you will find a config option called default document. Make sure you add Main.aspx to that list, preferably to the top.

Edit: If you have all your pages in a subfolder you would need to either move the default document into the root or create a default.aspx in the root and redirect from that page load as IIS cannot use pages in subfolders as the default document.

ThatChris
  • 722
  • 1
  • 4
  • 16
1

Did you enable default documents in the IIS manager?

https://technet.microsoft.com/en-us/library/cc754807(v=ws.10).aspx

Menahem
  • 3,592
  • 1
  • 25
  • 40
0

If you are newbie in IIS like me i think this might help you:

Now all work for me!

Community
  • 1
  • 1