I can access the css-file but the website is still not applying the classes

Folder-Tree:

example.com/css/style.css
example.com/index.html

HTML Head:

<!DOCTYPE html>
<html lang="de-DE">
<head>  
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="./css/style.css">

If I click "View Page Source" I can click on the css link and I see my file.

I can even type in the adress bar the url "example.com/css/style.css" and I see my file.

I open Firefox Developer Inspect and it gives a Success 200 Code for loading the css-file.

I delete the browser-cache, no change.

I download the html-file and put it into a folder with the css-file. Open it with Visual Studio Code Live Server and it looks right, the css is loading. The same code.

Why does it not work online?

EDIT:

I just saw that in the Firefox Inspector, the html head is greyed out. Both online and offline but offline seems no problem.


Solution 1:

LPChip suggested me to use the debugger/inspector of Firefox and there, the head is greyed out. On further investigation, I noticed it said "css was not loaded because its mime type "text/html" is not "text/css"

That made me check something...

I got the solution:

I had an apache mod_rewrite activated. While the path was correct, it seems that this mod_rewrite or the dedicated php for the redirection somehow told the browser that the file was html not css.