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

    Customizing Error Page

    Scheduled Pinned Locked Moved pfBlockerNG
    22 Posts 7 Posters 3.9k 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.
    • R
      rickygm @Grunt0307
      last edited by

      @Grunt0307 Hi, I'm not an expert, but where would the modification or what path and file would I have to add?

      1 Reply Last reply Reply Quote 0
      • G
        Grunt0307
        last edited by

        If you want to duplicate what is in the screenshot above, SSH into your pfsense box and enter the below command to create a new error page, then paste my above code into it.

        vi /usr/local/www/pfblockerng/www/dnsbl_custom.php

        After you've done all that, go to the admin guiI>Firewall>pfBlockerNG>DNSBL. Under the DNSBL Configuration section, you should see a list, dnsbl_default.php and your new file, dnsbl_custom.php. Select dnsbl_custom.php and then save, the change is immediate.

        1 Reply Last reply Reply Quote 0
        • R
          rickygm
          last edited by

          thank for you help.

          1 Reply Last reply Reply Quote 0
          • BBcan177B
            BBcan177 Moderator @Grunt0307
            last edited by BBcan177

            @Grunt0307 said in Customizing Error Page:

            I am running pfSense 2.4.4 with pfBlockerNG-devel 2.2.5_23. I created and slightly altered the CSS styling of the block page. What i want to do is change the information in the table that appears from referrer, client, user agent to client, feed or client, category. I see where that information is pulled by index.php in what I think is an array variable, but I am unsure of what other values exist in that array. Is what I'm asking for possible, does anyone know where I can find out what additional values can be used?

            Check out the latest Block Page... Still a bit of work to go before I release it, so test it out and send back any feedback!
            Thanks!

            Desktop/Mobile views:
            03db28bd-1af4-4cf0-895f-1130d53dbe44-image.png

            b4d639ca-8e2f-4ecf-bafe-b3ab008ffa99-image.png

            Instructions:

            From a pfSense shell or from pfSense Diagnostics > Command Prompt > Execute Shell Command:

            fetch -o /usr/local/www/pfblockerng/www/index.php "https://gist.githubusercontent.com/BBcan177/1c4c9a1dfece234a14caf2407629153c/raw"
            
            fetch -o /usr/local/www/pfblockerng/www/dnsbl_new.php "https://gist.githubusercontent.com/BBcan177/aa72e472db2b251ed188a51e1166c1d1/raw"
            

            Then in the DNSBL Tab > Blocked Webpage: select the "dnsbl_new.php" webpage and Save.

            "Experience is something you don't get until just after you need it."

            Website: http://pfBlockerNG.com
            Twitter: @BBcan177  #pfBlockerNG
            Reddit: https://www.reddit.com/r/pfBlockerNG/new/

            1 Reply Last reply Reply Quote 4
            • G
              Grunt0307
              last edited by

              Cool, however, it doesn't look like something is working quite right. Do I need to restart pfblocker?

              53f33ac9-ff59-45e2-b281-3a21b4c57ce3-image.png

              T 1 Reply Last reply Reply Quote 0
              • T
                turker
                last edited by turker

                5d969a98-0f37-49f4-918f-fe5a831b0c7d-image.png 👍

                1 Reply Last reply Reply Quote 0
                • T
                  turker @Grunt0307
                  last edited by turker

                  @Grunt0307 said in Customizing Error Page:

                  Cool, however, it doesn't look like something is working quite right. Do I need to restart pfblocker?

                  53f33ac9-ff59-45e2-b281-3a21b4c57ce3-image.png

                  Same problem. Refresh a page. Then it works

                  1 Reply Last reply Reply Quote 0
                  • G
                    Grunt0307
                    last edited by

                    Oh ya, that's strange...I'm not nearly savvy enough to understand why that's happening though.

                    1 Reply Last reply Reply Quote 0
                    • BBcan177B
                      BBcan177 Moderator
                      last edited by

                      There was a change to the code yesterday. So not sure when you downloaded those files? Please re-run those two commands to get the latest revision:

                      https://www.reddit.com/r/pfBlockerNG/comments/c008j5/provide_feedback_on_new_dnsbl_block_page/

                      "Experience is something you don't get until just after you need it."

                      Website: http://pfBlockerNG.com
                      Twitter: @BBcan177  #pfBlockerNG
                      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                      G 1 Reply Last reply Reply Quote 0
                      • G
                        Grunt0307 @BBcan177
                        last edited by

                        @BBcan177 Still the same behavior.

                        BBcan177B 1 Reply Last reply Reply Quote 0
                        • BBcan177B
                          BBcan177 Moderator @Grunt0307
                          last edited by

                          @Grunt0307
                          Re-select the default block page, save, then select the new test webpage and save.

                          "Experience is something you don't get until just after you need it."

                          Website: http://pfBlockerNG.com
                          Twitter: @BBcan177  #pfBlockerNG
                          Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                          G 1 Reply Last reply Reply Quote 0
                          • G
                            Grunt0307 @BBcan177
                            last edited by

                            @BBcan177

                            Yup, that's the first thing I did. Ran the two commands to pull down the new files, then went into the gui, selected the default page and saved it, then selected the new page and saved it. Still getting nothing in some of the fields on first load but refreshing the page fills in the info.

                            BBcan177B 1 Reply Last reply Reply Quote 0
                            • BBcan177B
                              BBcan177 Moderator @Grunt0307
                              last edited by BBcan177

                              @Grunt0307

                              A new revision has been made to add a small timeout to the code... Thanks for @Grunt0307 for testing it out! Appreciate the Feeback and Support!

                              For anyone having the same issue, please re-download the index.php file as per my previous command.

                              "Experience is something you don't get until just after you need it."

                              Website: http://pfBlockerNG.com
                              Twitter: @BBcan177  #pfBlockerNG
                              Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                              1 Reply Last reply Reply Quote 0
                              • T
                                turker
                                last edited by

                                @BBcan177 said in Customizing Error Page:

                                please re-download the index.ph

                                I changed index.php. I ran these two commands again. same behavior
                                (win1064 chrome, firefox,edge. android. ipad safari.)

                                1 Reply Last reply Reply Quote 0
                                • R
                                  rickygm
                                  last edited by

                                  not work for me.

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    arian_0098
                                    last edited by arian_0098

                                    @BBcan177

                                    S***y design, but same issue ... should refresh the page to view other infos.

                                    Grabbed files yesterday and did exactly like you said.

                                    BBcan177B 1 Reply Last reply Reply Quote 0
                                    • BBcan177B
                                      BBcan177 Moderator @arian_0098
                                      last edited by

                                      New version posted today - re-download.

                                      "Experience is something you don't get until just after you need it."

                                      Website: http://pfBlockerNG.com
                                      Twitter: @BBcan177  #pfBlockerNG
                                      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                                      A M 2 Replies Last reply Reply Quote 1
                                      • A
                                        arian_0098 @BBcan177
                                        last edited by

                                        @BBcan177 said in Customizing Error Page:

                                        New version posted today - re-download.

                                        Fixed ... it refreshes the page immediately ... but curious to know why this issue wasn't present in last template.

                                        1 Reply Last reply Reply Quote 0
                                        • M
                                          mikekoke @BBcan177
                                          last edited by mikekoke

                                          @BBcan177
                                          Hi, I'm trying the new block page, it works on all mobile and desktop devices that I have, the only problem I noticed is that after the first restart of pfsense the block page no longer shows the referer.
                                          Is there any solution for this problem?
                                          Thanks for all the work you do.

                                          EDIT: Loading the blocked site with Chrome desktop and mobile the referer works the first time the page is loaded but if you reload the page other times the referer is not shown. With microsoft edge and firefox the referer is not shown even the first time you load the page.

                                          1 Reply Last reply Reply Quote 0
                                          • NollipfSenseN
                                            NollipfSense
                                            last edited by

                                            Pleasant logo...added it to pfSense 2.5/pfBlockerNG-dev!

                                            Screen Shot 2020-01-30 at 12.26.58 PM.png

                                            pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                                            pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

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