Search code examples
asp.net-mvc-4iis-7.5

"You do not have permission to view this directory or page." on IIS7.5 with ASP.NET MVC4


I built my site in ASP.NET MVC 4 in Visual Studio 2012. I then created a publish profile and using FTP as my method of publishing, I published to the correct directory on my Windows Server 2008 R2.

I have logged into the Server and checked that all files have been uploaded, they have.

But still when I browse to the site, I get:

You do not have permission to view this directory or page.

How can I fix this issue? my site works fine on Localhost.

Thank You.


Solution

  • Sometimes this may happen, when you have two or more sites on IIS with the same port number and when you have published the site, you have forgotten to switch ftp to your target site. In this case you just need to turn on your ftp and try to publish again. If not:

    You may navigate to a folder on your server, where the site was published and modify the permissions:

    Right click on folder -> Properties -> Security - >Edit
    

    You should set rights for IIS_IUSRS and Users to allow read and write. If they don't exists add them and set the rights.