moving website to new hosting causes "forbidden"
Asked Answered
M

5

6

I am moving website from one hosting server to another hosting server. I have uploaded files. I am using forms authentification. Basically, I am moving to GoDaddy.

I can access login form directly: www.mysite.com/login.aspx However, when I open www.mysite.com it shows

Forbidden
You do not have permission to access this document.

What can cause this problem? Which files do not have permissions? Should I modify web.config or anything else?

I am using asp.net version 3.5.

Merge answered 4/4, 2015 at 13:53 Comment(3)
Your default page seems to not be configuredMolehill
Why then it was working on the previous web hosting server? I mean, I really do not see anything that is configured for default page. But should not web page redirect to login page by default if Forms authentification is set?Merge
Just to verify with above suggestion, set default document and try!Twum
J
3

Problem:

IIS has configuration for default document, which is typically default.htm, default.aspx, etc. but not login.aspx. If site has no default document in the root folder and directory browsing feature is disabled you will get the Forbidden message.

Solution:

  • Either create default document as per default IIS configuration
  • or change IIS configuration to make login.aspx your default document

To create default document, add a new file, name it as default.htm and copy to the root directory of your site

<html>
   <head>
      <meta http-equiv="REFRESH" content="0;url=login.aspx">
   </head>
   <body></body>
</html>

To change IIS configuration, go to your hosting settings panel and find Web Server Settings feature where you could add login.aspx to the list of default documents for your account.

enter image description here

Justino answered 28/4, 2015 at 6:57 Comment(0)
P
2

Sounds to me that the default page in IIS is not set. It appears that your default page is Login and the IIS default is Default.

Poindexter answered 27/4, 2015 at 17:24 Comment(0)
W
1

It may be because the IIS is not finding a default start page. Adding default document in IIS is one way. But an other way is adding default document (start page) in web.config file.

Suppose if you want to open login.aspx page when some one opens your website, then add following code in web.config file

   <system.webServer>
     <defaultDocument>
            <files>
                <clear />               
                <add value="Login.aspx"/>
            </files>
        </defaultDocument>
    </system.webServer>
Weltpolitik answered 2/5, 2015 at 1:43 Comment(0)
S
0

Think about the basics of how your web server works.

You have one file root folder (typically named www/ or public_html/ or something else depending on your setup) and you have sub folders and files within the root folder.

Web servers work so that they only allow public access to your "public root folder" and not your server files / language specific folders / system folders etc.

And now think about your error message for a second, it tells you that "You do not have permission to access this document." Which is basically talking about either your default.aspx or index.html or some other form of default/index file which loads when you load your root domain.

This is due to "permission error" on that particular file / dependent files etc, exactly as the error message states. You need to check the access mode of your files and folders, which in unix is done by chmod command, and in windows located in file/folder properties -> security -> Permissions which usually lists within a group of users, ie your public/all user group (if it exists) You need these settings to give read or execute (exec depending on what type of file it is, if html/aspx than read is sufficient, strictly not write in any case as that allows modification to your files by the public) permissions in order for the web server to serve them to public successfully.

In order to give system specific help, your ASP.NET version is not enough to solve it, your IIS info is also needed as well as your server and file system setup etc

Stoichiometry answered 2/5, 2015 at 10:13 Comment(0)
L
-1

Asp.net is probably not registered on your new server. You can check it my adding an simple html file to your folder and try to browse it. As .net is not registered, the aspx extension is unknown.

You should run aspnet_regiis.exe -ir :

  1. %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -ir
  2. %windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -ir
Latinist answered 27/4, 2015 at 13:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.