[Solved] IIS Error: You do not have permission to view this directory or page

pratikshir
 
on Mar 15, 2021 01:45 AM
5239 Views

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

on subdomain is working.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Mar 15, 2021 01:50 AM

Hi pratikshir,

You need to set Default documents for your website.

Refer below article.

Set default page for your website in IIS using Web.Config file in ASP.Net

pratikshir
 
on Mar 15, 2021 04:29 AM
on Mar 15, 2021 04:31 AM

given code added below web.config still not showing & given the error 

The page cannot be displayed because an internal server error has occurred.

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <defaultDocument enabled="true">
 <files>
    <clear/>
    <add value="Home.aspx"/>
 </files>
</defaultDocument>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" defaultLanguage="c#" />
  </system.web>
  <connectionStrings>
    <add name="constr" connectionString="Data Source=(local);Initial Catalog=MetaTagsDB;User id = sa;password=123" />
  </connectionStrings>
  <!--Data Source=.;Initial Catalog=Kaaryashala;Integrated Security=True-->
</configuration>

 

dharmendr
 
on Mar 15, 2021 04:49 AM

You need to add defaultDocument within the system.webServer section.

 

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <defaultDocument enabled="true">
      <files>
        <clear/>
        <add value="Home.aspx"/>
      </files>
    </defaultDocument>
  </system.webServer>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" defaultLanguage="c#" />
  </system.web>
  <connectionStrings>
    <add name="constr" connectionString="Data Source=(local);Initial Catalog=MetaTagsDB;User id = sa;password=123" />
  </connectionStrings>
  <!--Data Source=.;Initial Catalog=Kaaryashala;Integrated Security=True-->
</configuration>