I'm trying to run a
localhost version of a website and the stylesheet for the site in inexplicably inaccessible to the browser.
- OS: Windows
- Browser: Chrome (have also tried Edge)
- Editing environement: Eclipse
- XAMPP: v3.2.4
This is how I'm calling the CSS file.
<link href='/style.css' rel='stylesheet' type='text/css' />
I'm updating some PHP on a site that is fairly old, the site was using PHP 5.5.9 and we want to update it to the latest PHP (off the top of my head it's 7.2.3). In doing this I want to modify the site code locally before changes are applied to our server. The server is Linux based so that is one fundamental dependency that is different from my local environment.
A problem that I've run into is that the CSS file returns either error 404 or error 403 if the location
https://localhost/style.css is put into the chrome browser. It seems that this happens if the path to the CSS file is wrong or the permissions to the file are not readable. I've tried converting the path of the CSS to an absolute path, I've checked the permissions and the system has all the read capability it needs.
I thought the problem might have been with the actual path to the CSS, but it's in the same location as the all the PHP files which are loading in just fine, whether using relative root location or document root. Note, the document root is now a subfolder with the HTML docs that contains all the website files for the page.
And please note that I've not modified this CSS file at all. It's the same as the one running on the live site.