I compressed my project folder and uploaded it to the Document Root
for the subdomain. All of my CSS and JS files are located inside the Public folder. The project works perfectly fine on XAMPP, but when I transfer it to my shared hosting, the CSS and JS files do not load. Clicking on the URLs generated for the CSS and JS from the View Page Source
, I am getting a 404 Not Found
error.
Checking the Console tab in the Inspect Element tool, I am seeing a
Failed to load resource: the server responded with a status of 404 (Not Found)
error. However, I have verified that the files exist in the same folders as they did when the project was working locally on XAMPP.
The method I used to link my CSS files is as follows:
<link rel="stylesheet" href="<?php echo asset('public/vendor/bootstrap/css/bootstrap.min.css') ?>" type="text/css">
The PHP version on my server is 7.3.23
and the version of Laravel I am using is 6.18.42
.