I am trying to deploy a laravel
application on A2Hosting shared hosting. My document root is: /public_html directory. I uploaded everything from my laravel
application except the public folder to the /beta directory of hosting.
And then I uploaded everything from the public directory to the /public_html directory.
In my index.php file, I changed the following two lines:
require __DIR__.'/../beta/vendor/autoload.php';
$app = require_once __DIR__.'/../beta/bootstrap/app.php';
Now I am only seeing the home page of my application correctly. That is, mydomain.com. Any hyperlink followed by mydomain.com is showing a 404 message. In my view files, this is how I am referring to a path:
<a href="/login">Login</a>
But after deploying the application, whenever I hit that link, i.e. mydomain.com/login, I get the 404 Not Found: The resource requested could not be found on this server!
message. I tried changing /login
to login
in the <a>
tag. Same result. How do I solve this?