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

    Portal Page with CSS -> Browser says: did not parse stylesheet. why?

    Scheduled Pinned Locked Moved Captive Portal
    7 Posts 2 Posters 2.8k 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.
    • F
      fips
      last edited by

      Hi,

      I installed a portal page, with an included css.
      Here the part of my portal page html:

      I created a simple css named it captiveportal-test.css and uploaded via Filemanager.

      If i view captive portal via "Captive Portal Configuration -> HTML Page Contents -> view " My browser doesn't load the css and just write following error:
      "Did not parse stylesheet at 'http://10.1.120.1:8002/captiveportal-test.css' because non CSS MIME types are not allowed in strict mode."

      Please help

      Thanks
      Stefan

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

        Hi,

        Can you visit Services => Captive Portal => [zone] => File Manager
        and list the uploaded files that are in the list ?

        It will take you 5 secondes, before you understand that this :
        @fips:

        I created a simple css named it **captiveportal-**test.css and uploaded via Filemanager.

        was not a good idea.

        True, in your html file you should reference the file like this:

        The captiveportal- part is auto added by pfSense - this is done when the file was uploaded.

        If you named your file **captiveportal-**test.css before uploading, your file will be named **captiveportal-****captiveportal-**test.css ones you uploaded it (I spoiled your 5 sec searching ;) )

        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
        • F
          fips
          last edited by

          Hi,

          no before uploading I removed the captiveportal- part of the filename.
          Forgot to wrote the right name  :D
          But it still doesn't work, clients who connect to the wlan via captive portal see the correct site, with loaded css.
          Only the "view" function give this result.

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

            In that case :
            @Gertjan:

            Can you visit Services => Captive Portal => [zone] => File Manager
            and list the uploaded files that are in the list ?

            answer the question.

            edit : also check the Status / System / Logs/ System / General (I presume you have have Status / System / Settings / Web Server Log checked.

            You find lines like
            2016-06-30 00:38:25 Local5.Info 192.168.1.1 Jun 30 00:38:28 pfsense.brit-hotel-fumel.net nginx: 192.168.2.42 - - [30/Jun/2016:00:38:28 +0200] "GET /captiveportal-style.css HTTP/1.1" 200 836 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fclients3.google.com%2Fgenerate_204" "Mozilla/5.0 (Linux; Android 5.0.2; P023 Build/LRX22G; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Safari/537.36"
            if it succeeds sending the file (mine is called captiveportal-style.css)
            You'll be having an error if it can't send the file.

            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
            • F
              fips
              last edited by

              Here the list of files

              ![Screen Shot 2016-06-30 at 14.19.14.png](/public/imported_attachments/1/Screen Shot 2016-06-30 at 14.19.14.png)
              ![Screen Shot 2016-06-30 at 14.19.14.png_thumb](/public/imported_attachments/1/Screen Shot 2016-06-30 at 14.19.14.png_thumb)

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

                Ok, the file is there …. (normally, I also check myself - because : Never trust a machine if you can check yourself)
                SSH in, option 8 and

                [2.3.1-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root: ls -al /usr/local/captiveportal/
                total 40
                drwxr-xr-x   2 root  wheel    512 Jun 30 14:26 .
                drwxr-xr-x  15 root  wheel    512 Jun 20 10:03 ..
                lrwxr-xr-x   1 root  wheel     39 Oct 16  2015 captiveportal-bg.jpg -> /var/db/cpelements/captiveportal-bg.jpg
                lrwxr-xr-x   1 root  wheel     42 Jan 29  2015 captiveportal-style.css -> /var/db/cpelements/captiveportal-style.css
                -rw-r--r--   1 root  wheel  10454 May 16 23:22 index.php
                -rw-r--r--   1 root  wheel  10434 May 16 23:22 radius_accounting.inc
                -rw-r--r--   1 root  wheel   6862 May 16 23:22 radius_authentication.inc
                [2.3.1-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root:
                

                As shown, the file where the link points to is /var/db/cpelements/captiveportal-style.css
                Right ?? Is it there ? Can you read that file ( cat /var/db/cpelements/…... )

                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
                • F
                  fips
                  last edited by

                  Maybe you misunderstood me:
                  The captiveportal works fine with the css, if someone connect via interface.
                  It just not load the css files if i watch the portal page over the pfsense webconfigurator.

                  attached file: That "view" button i press.

                  Files on pfsense:

                  [2.3.1-RELEASE][root@fw.int]/root: ls -la /usr/local/captiveportal/
                  total 40
                  drwxr-xr-x   2 root  wheel   1024 Jun 30 13:42 .
                  drwxr-xr-x  15 root  wheel    512 May 20 12:01 ..
                  lrwxr-xr-x   1 root  wheel     39 Jun 29 15:23 captiveportal-bg.jpg -> /var/db/cpelements/captiveportal-bg.jpg
                  lrwxr-xr-x   1 root  wheel     43 Jun 29 15:28 captiveportal-custom.css -> /var/db/cpelements/captiveportal-custom.css
                  lrwxr-xr-x   1 root  wheel     44 Jun 29 15:24 captiveportal-fitlogo.png -> /var/db/cpelements/captiveportal-fitlogo.png
                  lrwxr-xr-x   1 root  wheel     56 Jun 29 15:24 captiveportal-fontawesome-webfont.ttf -> /var/db/cpelements/captiveportal-fontawesome-webfont.ttf
                  lrwxr-xr-x   1 root  wheel     57 Jun 29 15:24 captiveportal-fontawesome-webfont.woff -> /var/db/cpelements/captiveportal-fontawesome-webfont.woff
                  lrwxr-xr-x   1 root  wheel     53 Jun 29 15:24 captiveportal-jquery-1.11.1.min.js -> /var/db/cpelements/captiveportal-jquery-1.11.1.min.js
                  lrwxr-xr-x   1 root  wheel     45 Jun 30 13:42 captiveportal-success.html -> /var/db/cpelements/captiveportal-success.html
                  lrwxr-xr-x   1 root  wheel     41 Jun 30 13:05 captiveportal-test.css -> /var/db/cpelements/captiveportal-test.css
                  lrwxr-xr-x   1 root  wheel     49 Jun 29 15:27 captiveportal-uikit.active.css -> /var/db/cpelements/captiveportal-uikit.active.css
                  lrwxr-xr-x   1 root  wheel     42 Jun 29 15:25 captiveportal-uikit.css -> /var/db/cpelements/captiveportal-uikit.css
                  lrwxr-xr-x   1 root  wheel     45 Jun 29 15:25 captiveportal-uikit.min.js -> /var/db/cpelements/captiveportal-uikit.min.js
                  lrwxr-xr-x   1 root  wheel     44 Jun 29 15:25 captiveportal-wa_logo.png -> /var/db/cpelements/captiveportal-wa_logo.png
                  -rw-r--r--   1 root  wheel  10454 May 16 23:22 index.php
                  -rw-r--r--   1 root  wheel  10434 May 16 23:22 radius_accounting.inc
                  -rw-r--r--   1 root  wheel   6862 May 16 23:22 radius_authentication.inc
                  
                  

                  ![Screen Shot 2016-06-30 at 16.23.28.png](/public/imported_attachments/1/Screen Shot 2016-06-30 at 16.23.28.png)
                  ![Screen Shot 2016-06-30 at 16.23.28.png_thumb](/public/imported_attachments/1/Screen Shot 2016-06-30 at 16.23.28.png_thumb)

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