I am new to hosting web apps online. I wanted to host an app in my subdomain eg departmennt1.example.com
. I added the subdomain in cPanel. Located its directory in file manager. It happens that the subdmain is also a folder in the root directory. I upload the locally working site in the subdomain folder. After setting up my database on the .env
folder. I also ensure that my public folder files were inside the subdomain folder. I ensure that the app and the autoload.php
in index.php
file in the subdomain folder is pointing correctly to the vendor and boostrap folder.
After that, I tried loading the subdomain address in the browser, but only the index page ie.
Route::get('/', function () {
return view('welcome');
});
any other URL will return like login will show
Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
I tried it on another hosting company where the subdomain by default resides in the public_html
directory and everything worked out fine.
How can I host at the first hosting company?