Another way to block/redirect with this plugin
-
Personally, I don’t like to show that I’m doing any sort of blocking, Especially what I’m blocking or how I’m going about it (Like by IP or Country for example). I’m not a fan of the 401 or 403 responses!
However, this plugin does give an additional option of redirecting users to another page on your site. It’d be nice if it could allow you to redirect to another site all together… But this is still entirely doable!
I created a non-advertized (hidden / not in any menu / whatever) “Site Unavailable” page with a unique slug or path “site.com/site_unavailable” for example. You can add some classy text to the page if you want… I’ve then configured all banned countries to be redirected to this page. Then I added the below code to the top of my root .htaccess file:
# START 301 REDIRECTS Options +FollowSymLinks RewriteEngine On RewriteRule ^site_unavailable.*$ https://www.google.com/ [R=301,L] # END 301 REDIRECTS
So now when a user in a banned Country tries to go to my site, they’ll be redirected to the “Site Unavailable” page which will in turn immediately redirect them to {For Example:}Google, off of and away from my site with no 401-403 response or any block notice.
I used Google as an example; but you can put whatever URL you want (Competitor website maybe?) or even a URL that doesn’t exist… Anyway, nice plugin that does an important job. Thanks!
- The topic ‘Another way to block/redirect with this plugin’ is closed to new replies.