Corvid code working in preview mode, but not in live site

I used a code copied from the internet for blocking IP according to GEO location. (Purpose of the code is to, read the IP address and redirect to a page named “Not-available”. Code works well with the Preview mode. But it does not work with the Live site.

This is the code I have used. I have attached the code as an image, because I cant post questions with Links.

Where did you get this script from? Perhaps it’s no longer supported? You should ask the script’s author for assistance.

You might find the forum post Block an ip and redirect to another page useful.

BTW - are you sure that you have the correct page URL? You can check under the page SEO settings. Like this: