TLDR; I had my code in a sub directory that was unable to find my stylesheet
Hi Windows Users on Xampp/mampp/lampp in 2019. I have a fix that worked for me that will work for you and it's to do with our environment setup. This was from a Laracasts Tutorial. PHP Practitioner
This was a breaking point for me and i made it over so you can too!
This is regarding both the errors where you copied jeffs code and still get a 404 OR you receive the error "Resource interpreted as Stylesheet but transferred with MIME type text/html".
First off, your .htaccess file should look like this:
RewriteEngine On
AddType text/css .css
AddType text/javascript .js
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteRule ^.*$ index.php [END]
Secondly all of your project files MUST 1000% go to your htdocs folder located at: C:\xampp\htdocs
Finally, if you are getting any more errors after this please email me at [email protected] and i will personally help you
Answer from Roman Ozerski on Stack Overflowexternal css linked with html not working with apache server
CSS not linking with Apache 2 Server - Raspberry Pi Forums
Updated to Apache 2.4 and now my style sheets do not load - Server Config - SitePoint Forums | Web Development & Design Community
[SOLVED] display correctly css files in apache2
Enable mod_mime and add the following lines in your httpd.conf (or a .htaccess):
AddType text/css .css
AddType text/javascript .js
When I load your website and look into the console, it displays the following error
[16:37:08.652] The stylesheet http://shurl.be/layout/stylesheets/css/test.css was not loaded because its MIME type, "text/plain", is not "text/css". @ http://shurl.be/
It seems you're missing an appropriate mime type. Although, the default configuration of debian should do this already.
I think I see the problem. Your SetHandler is applying to every possible URL in the virtual host, without regard for whether it is a PHP file or not. Thus everything gets passed to PHP, even if it is a static file. And because PHP's interpreting the static file as PHP, you get the results you got.
You should instead send only requests for PHP files to the handler, by selecting them by filename:
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9072"
</FilesMatch>
You can then remove the unnecessary redundant <Files> bits that you had added.
The 403 error usually comes from a permission error. It could either be at the directory or the files level.
In your case, from what I can see (only the file and the apache doc root directory permissions), permissions seems fine.
Could you share with us the parents directories permissions? (it could be the /var/www/dev/ that have too restrictive permissions)
If the permissions aren't allowing "other", 0755 should do it...
chmod 0755 /var/www/dev
Also, /var/www/dev should belong to "dev-admin". If that isn't the case, I would suggest to change the ownership of it:
chown dev-admin: /var/www/dev
And @Michael Hampton is right. None of your changes were required (on a default CentOS 7 Apache configuration).
Ohh! Just to make sure that we are covering all the bases... Does dev-admin is the Apache user?
If not, you may either change it within the main Apache configuration or by changing the dev directory (recursive) with the proper user.