Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Uploaded CSS wont render - transfered with MIME type text/html

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 2 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • crlsgmsC
      crlsgms
      last edited by

      Hello everyone.

      I sent up all files I neet to host my captive portal front page, and I use a.js and some .css files. I uploaded all the images, css and js files to the captive and set up them accordingly, considering the name changing on upload to captiveportal-file.js (for ex.)

      But when trying to preview the page on the webgui I have this error:

      Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://20.15.19.9:8002/captiveportal-style.css".
      index.php:16 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://20.15.19.9:8002/captiveportal-v4.css".
      index.php:17 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://20.15.19.9:8002/captiveportal-v4_mobile.css".
      

      And Im loading them as follows on the .html file:

      also Im trying to use svg, I read some other posts that I have to change some settings on lighttpd, but thats another history, and I can change them to png, or jpg after, but for now I just wanted the page to be loaded as I can see it on brackets. Did I miss something to work with css and pfsense captive portal?

      I want to get this result:

      But I got this when calling preview from the webgui:

      1 Reply Last reply Reply Quote 0
      • crlsgmsC
        crlsgms
        last edited by

        Well, I tried some steps:

        • Via ssh, used the pFsene.css file as refference, and pasted my css over a copy of it, so the encoding would be the same as a already working css, no success.

        • before uploading, changed the encoding of css file to utf-8 on sublime, with iconv and recode, no success.

        • revamp all code only to have the suggest block

        <form>from the captive portal, and setup simple css / js rules to it, same result.

        Just to be sure so I could keep researching, is it possible to use css and js with pfsense captive portal? What should I have in mind or setup to use such tools?</form>

        1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan
          last edited by

          Google knows a lot about "Resource interpreted as Stylesheet but transferred with MIME type text/html".
          It isn't a pfSense or FreeBSD or even nginx or apache2 issue.

          It happens when …. well .... you'll find it out.

          I'm also using this :

          
          		<title>xXx</title>
          
          .....
          

          The file "captiveportal-style.css" is the uploaded style.css file.
          Always worked for me.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.