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 Overflow
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › using-stylesheet-on-apache-server-247415
Using stylesheet on Apache-server?
Hi! I'm a newbie with apache, and I'm running Debian without any GUI. I'm using the default settings in apache, and my html-files are placed in /var/ww
Discussions

external css linked with html not working with apache server
Problem description External css not applyint styles to html on apache localhost Steps to reproduce both html and css are in same folder(/data/data/com.termux/files/usr/share/apache2/default-site/h... More on github.com
🌐 github.com
6
June 18, 2020
CSS not linking with Apache 2 Server - Raspberry Pi Forums
The simplest is to move the CSS ... to get rid of the "..". The other is to put something like a Alias statement in your web server config so that if you specifiy href="CSS/something" it looks in /var/www/CSS instead. In Apache this could be... More on raspberrypi.org
🌐 raspberrypi.org
November 25, 2017
Updated to Apache 2.4 and now my style sheets do not load - Server Config - SitePoint Forums | Web Development & Design Community
I’ve configured Apache 2.4 exactly as the previous version, updated to PHP 8, but now no stylesheets are loading, just html. Using developer tools in Edge (and other browsers) I can apply the styles and everything looks fine. AddType text/css .css is included in my config file. More on sitepoint.com
🌐 sitepoint.com
0
July 24, 2023
[SOLVED] display correctly css files in apache2
Hi, I coded a website with html+php+mysql+apache2, everything works fine except that the css doesn't display, particulary the images and some other css classes, so, I tried to modify my apache2.conf adding this line: AddType text/css .css But still doesn't work Also, googling, I found that I can ... More on forums.phpfreaks.com
🌐 forums.phpfreaks.com
6
July 25, 2008
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › general programming discussion
CSS not linking with Apache 2 Server - Raspberry Pi Forums
2. then go the /var/www and right click on the "www" folder then properties and i change the permission on "view content", "change content", and "access content" to allow "anyone" view content: anyone change content: anyone access content: anyone 3. restart apache2 server type: service apache2 restart 4. then test the webpage i hope this helps, it worked fine with me. ... Bad practice. Permissions are there for a reason. Also, replying to a two year old post is silly. ... Id rather put the stylesheet inside /var/www/html/style.css.
🌐
Ask Ubuntu
askubuntu.com › questions › 757305 › apache-2-4-7-doesnt-load-all-css-files
apache2 - Apache 2.4.7 doesn't load all .css files - Ask Ubuntu
The file /var/www/html/css/style.css will be loaded correctly. The file /var/www/html/css/modalCustomization.css will not be loaded. Any suggestions why the Apache on the ubuntu server is doing/not doing that? ... I just found a solution from another question. Everything works if I add a ./ before the path in index.html.
🌐
GitHub
github.com › termux › termux-app › issues › 1608
external css linked with html not working with apache server · Issue #1608 · termux/termux-app
June 18, 2020 - both html and css are in same folder(/data/data/com.termux/files/usr/share/apache2/default-site/htdocs) apachectl start Html file · <html> <head> <link rel="stylesheet" type="text/css" href="http://localhost:8080/main.css" /> </head> <body> <h1> Chapter 1.</h1> <h1>Chapter 1.</h1> </body> </html> main.css · <style> h1 { color: red; } </style> Expected behavior · Expected behaviour is all h1 headings in browser to be in red colour · Additional information ·
Author   tathastu871
🌐
Nick Bettison
linickx.com › css-styling-apache-directory-listings
CSS Styling Apache Directory Listings. | Nick Bettison LINICKX.com
The work can be done in one of two ways either by pasting Apache directives into a .htaccess file (in the directory you want to apply conf to), or in your httpd.conf you can wrap it all up in a ... RewriteEngine Off AddType text/html .shtml ...
🌐
Apache
tapestry.apache.org › css.html
CSS - Apache Tapestry
For Tapestry 5.4 and later, the core JavaScript stack also includes the CSS for Bootstrap 3.1.1. Tapestry 5.5.0 and later also includes Bootstrap 4.3.1. To use it, just add @ImportModule(Bootstrap4Module.class) to your application's module class (normal AppModule.java):
Find elsewhere
🌐
Apache
cwiki.apache.org › confluence › display › WICKET › Including+CSS+resources
Including CSS resources - Apache Wicket - Apache Software Foundation
add(CSSPackageResource.getHeaderContribution(MyClass.class, "style.css")); You can add this to any component. Header contribution of style.css relative to MyClass will automatically be taken care off and double contributions will be filtered (ignored).
🌐
Htmlhelp
forums.htmlhelp.com › index.php
Where to put css files? - HTMLHelp Forums
August 3, 2011 - HTMLHelp.com | HTML Reference | CSS Reference | FAQs | Validator · Forums | Rules | Members | Search | Help
🌐
SitePoint
sitepoint.com › server config
Updated to Apache 2.4 and now my style sheets do not load - Server Config - SitePoint Forums | Web Development & Design Community
July 24, 2023 - I’ve configured Apache 2.4 exactly as the previous version, updated to PHP 8, but now no stylesheets are loading, just html. Using developer tools in Edge (and other browsers) I can apply the styles and everything looks fine. AddType text/css .css ...
🌐
PHP Freaks
forums.phpfreaks.com › web server administration › apache http server
[SOLVED] display correctly css files in apache2 - Apache HTTP Server - PHP Freaks
July 25, 2008 - Hi, I coded a website with html+php+mysql+apache2, everything works fine except that the css doesn't display, particulary the images and some other css classes, so, I tried to modify my apache2.conf adding this line: AddType text/css .css But still doesn't work Also, googling, I found that I can ...
🌐
Nicoverbruggen
nicoverbruggen.be › blog › styling-apaches-index-of-pages
Styling Apache's "Index Of" directory pages | nicoverbruggen.be
Finally, add ignore flags for the header and footer pages (you don’t want these files to show up in the list of the directory!). Then it’s rather straightforward. Header is basically HTML with inline CSS (no external CSS for obvious reasons) where you can style the page, and footer just closes the body and html tags. That was simple, wasn’t it? A simple Apache ...
Top answer
1 of 2
4

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.

2 of 2
1

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.

🌐
Apache
jspwiki-wiki.apache.org › Wiki.jsp
Add CSS Style - Apache JSPWiki
%�d-css <css snippet> /% You can add any css snippet to a wiki-page, defining new styles or modifying the So, be careful not to make your site unaccessible or unreadable !
🌐
Webmaster World
webmasterworld.com › apache › 3589651.htm
Tutorial: Custom Apache Directory Listing with linked CSS, and PHP - Apache Web Server forum at WebmasterWorld - WebmasterWorld
Your open directory header, footer, stylesheet, and any Apache/CSS related images will all be placed in this directory. Remember: do not put these files in an already existing folder! ... I am posting my own header and footer files that may freely be used as an example to help ease implementation.