Redirect back to pi-hole whitelist on blocked domain


Description: When clicking on a blocked domain in a web browser redirect back to pi-hole to login and whitelist.

Many times I will be browsing the Internet and there are certain legitimate sites I would like to get to which are being blocked by pi-hole. I could just log into pi-hole and add to whitelist, but it would be nice if pi-hole could help with that.

I prototyped some code to support this:

  1. I added to list.php the following modification to accept get requests:

    <!-- Domain Input -->
    <div class="form-group input-group">
    <!-- PGMOD -->
    <input id="domain" type="text" class="form-control" value="<?php echo $_GET['domain']?>" placeholder="Add a domain ( or">
    <!-- PGMOD -->
  2. I am using apache and added this to the configuration within virtual host section

     RewriteEngine on
     RewriteCond %{HTTP_HOST} !^
     RewriteRule ^/(.*)${HTTP_HOST} [L,R=301]

This used to work when pi-hole returned the pi-hole server IP for the blocked domains. But now it is returning instead.

So this is a feature request to officially support automatic redirect blocked domain to pi-hole to allow the end user to decide to whitelist or not. Maybe it could even give some more detailed info on the blocked domain.


This is already implemented in the block page, which is active when using an IP-based blocking mode: