Moving a website to a new hosting causes a "ban",

I am moving a website from one hosting server to another hosting server. I uploaded the files. I use forms authentication. Basically, I am moving to GoDaddy.

I can access the 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 change web.config or anything else?

I am using asp.net version 3.5.

+6
source share
5 answers

Problem:

IIS has a configuration for the default document, which is usually default.htm, default.aspx, etc., but not login.aspx. If the site does not have a default document in the root folder and the directory browsing function is disabled, you will receive a Forbidden message.

Decision:

  • Or create a default document according to the default IIS configuration.
  • or change IIS configuration to make login.aspx the default document

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

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

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

enter image description here

+3
source

It seems to me that the default page in IIS is not set. Apparently your default page is "Login" and the default IIS is "Default."

+2
source

Perhaps this is due to the fact that IIS does not find the default start page. Adding a default document to IIS is one way. But another way is to add the default document (start page) in the web.config file.

Suppose if you want to open the login.aspx page when someone opens your site, add the following code to the web.config file

  <system.webServer> <defaultDocument> <files> <clear /> <add value="Login.aspx"/> </files> </defaultDocument> </system.webServer> 
+1
source

Think about how your web server works.

You have one root folder of the file (usually the name www / or public_html / or something else depending on your installation), and you have subfolders and files in the root folder.

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

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

This is due to a “permission error” in these files / dependent files, etc., as indicated in the error message. You need to check the mode of access to your files and folders, which in unix is ​​performed by the chmod command , and in the windows located in the file / folder properties → security → Permissions, which is usually displayed in a user group, i.e. your public / any user group (if one exists) You need these settings for reading or executing (exec depending on what type of file it has, if html / aspx than reading is sufficient, don't write strictly anyway, as this allows you to modify your files publicly) to allow the web server to serve them successfully.

To get specific help on the system, your version of ASP.NET is not enough to solve it, you also need your IIS information, as well as server and file system settings, etc.

0
source

Asp.net is probably not registered on your new server. You can verify it by adding a simple html file to your folder and try to view it. Since .net is not registered, the aspx extension is unknown.

You should run aspnet_regiis.exe -ir:

  • % windir% \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_regiis.exe -ir
  • % windir% \ Microsoft.NET \ Framework64 \ v2.0.50727 \ aspnet_regiis.exe -ir
-1
source

Source: https://habr.com/ru/post/984681/


All Articles