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



  • 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



  • 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 ;) )



  • 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.



  • 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.



  • 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)



  • 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/…... )



  • 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)


Log in to reply