Error when hosting our asp.net core MVC inside bluehost '403 Forbidden error was encountered while trying to use an ErrorDocument to handle the req'

john john 926 Reputation points
2022-09-22T13:04:19.217+00:00

I am working on an asp.net core MVC 3.1. and inside visual studio i can access the home page of the website as follow:-

243921-image.png

This is the code for the index method:-

public IActionResult Index()  
        {  
            return View();  
        }  

and the view:-

@{  
    ViewData["Title"] = "Home Page";  
}  
  
<html>  
<head>  
    <title class="text-center"></title>  
</head>  
<body>  
      
    <div class="text-center">  
    <a  href="~/file/CV.pdf">Click to view my CV</a></div>  
  
</body>  
</html>  

and when i click on the link a pdf will be shown inside the browser. now i published the website inside a folder and i used FileZilla to upload the files to the bluehost file-manager as follow:-

243893-image.png

but when i access the website http://www.ourcompany.com, i will get this error:-

243922-image.png

and if i try to access the pdf file directly using http://www.ourcompany.com/file/cv.pdf, i will get this error:-

enter image description here

any advice?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,124 questions
{count} votes