Server Error in '/' Application. Requested URL not correct

John Many 0 Reputation points
2023-03-10T16:50:44.7233333+00:00
when publishing my ASP.Net WebForm application I am getting the following error:

**The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /
**
I need the requested URL to be /welcome.html

I have tried the following:

- Went into Azure Portal and modified default documents to Welcome.HTML
- Changed the Web settings in my project to navigate to a specific page "Welcome.HTML"
- Changed my RouteConfig.cs file to the following
                name: "Default",
                url: "",
                defaults: new { controller = "Home", action = "Index", id = "" }
            );

Also to note I can direct to the welcome.html page directly no issue by modifying the url i.e., url.com/welcome.html
Developer technologies Visual Studio Other
Developer technologies ASP.NET Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Alan Farias 755 Reputation points
    2023-03-10T22:07:29.37+00:00

    It seems like your application is unable to find the default document when accessed without a specific file name. You can try the following steps:

    1. Ensure that the default document is set correctly in your project. To do this, right-click on the project in Visual Studio, select "Properties", and under the "Web" tab, make sure that "Welcome.HTML" is listed as the "Start Action" and as the first item in the "Specific Page" section.
    2. Check the web.config file in your project to ensure that the default document is listed correctly. Look for a line similar to the following:
        <defaultDocument>
          <files>
            <add value="Welcome.HTML" />
          </files>
        </defaultDocument>
        ```
        
        
          
        If this line is missing or incorrect, add or modify it accordingly.
    1. Ensure that the default document is set correctly in the Azure portal. Go to the "Configuration" blade for your app service, scroll down to the "Default documents" section, and ensure that "Welcome.HTML" is listed as the first item.
    1. Try accessing the root URL again. If the issue persists, check the Azure portal logs for any errors or warnings that may help identify the issue.
        
    I hope this helps you resolve the issue.
    
    ----------
    ***`I hope I was able to help! Don't forget to mark my answer as accepted if it was useful to you. Have a great day!`***
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.