-3

I am currently building a new website, I only got a css problem right now.

I ve got this between my head tag:

<link rel="stylesheet" type="text/css" href="css/style.css">

Only the problem is it doesn't load at all, tried things like: addin base url, put whole url in it.

Where I think the problem is, the .htaccess, when i remove it it works, but i still need the line for other things:

RewriteRule ^(.*)/(.*)$            index.php?region=$1&summoner=$2             [L]
  • I am not a design expert, but have you tried href="~/css/style.css". Also you sure about the path, is it valid? – Zerotoinfinity Oct 09 '18 at 19:22
  • This is the right way. You can even omit the `type` part. This is probably a cache or relative path problem. – Quentin Veron Oct 09 '18 at 19:22
  • This is the correct way, however, we obviously don't know the structure of your project. Your post suggest you have a 'style.css' file in a 'css' folder. I would clear cache when loading your index page too. – James Oct 09 '18 at 19:22
  • i cleared cache and everything: https://lds.gg/css/style.css is the link to the css but it redirects to homepage for some reason? @james – Anthony Bijlsma Oct 09 '18 at 19:27
  • 1
    Possible duplicate of [Resource interpreted as stylesheet but transferred with MIME type text/html (seems not related with web server)](https://stackoverflow.com/questions/22631158/resource-interpreted-as-stylesheet-but-transferred-with-mime-type-text-html-see) – Quentin Veron Oct 09 '18 at 19:31
  • URL rewriting glitch may be? Why is your style.css file serving a html document? – Salman A Oct 09 '18 at 19:33
  • I found the problem! I only don't know how to solve it but it's in the .htaccess: RewriteRule ^(.*)/(.*)$ index.php?region=$1&summoner=$2 [L] – Anthony Bijlsma Oct 09 '18 at 19:36

1 Answers1

1

Your css file is located at https://lds.gg/css/style.css, but your index.php file is not secure. You are likely going to have mixed content issues. Still, if you link to your css file like so:

<link rel="stylesheet" type="text/css" href="https://lds.gg/css/style.css">

you should be fine.

5150 Design
  • 179
  • 14
  • That is something i already tried, but that doesn't fix it. it is a .htaccess problem i noted earlier. – Anthony Bijlsma Oct 09 '18 at 19:42
  • Have you tried removing that directive from your .htaccess file? – 5150 Design Oct 09 '18 at 21:25
  • EDIT: Sorry, just saw your updated question. What is the rewrite rule supposed to do? It needs to be re-formatted so that it only addresses those pages that need to be redirected. You can try adding this to your .htaccess file above the rewrite rule: RewriteCond %{REQUEST_FILENAME} !-f – 5150 Design Oct 09 '18 at 21:38
  • Further reference: https://stackoverflow.com/questions/8221022/css-not-loading-after-redirect-with-htaccess-rewrite-rule – 5150 Design Oct 09 '18 at 21:41
  • I should note that when I go to https://lds.gg/css/style.css, it resolves to your style sheet. I'm pretty sure the absolute path will work. – 5150 Design Oct 09 '18 at 22:19