Title: Create an exception?
Last modified: August 30, 2016

---

# Create an exception?

 *  Resolved [moonandfox](https://wordpress.org/support/users/moonandfox/)
 * (@moonandfox)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/create-an-exception-1/)
 * Thanks for this plugin! I’m trying to use it to redirect based on country. What
   would be the best way to implement this, and to create an exception? For example,
   I want everyone in the US to be redirected except for my IP address.
 * Thanks!!
 * [https://wordpress.org/plugins/geoip-detect/](https://wordpress.org/plugins/geoip-detect/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Benjamin Pick](https://wordpress.org/support/users/benjaminpick/)
 * (@benjaminpick)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/create-an-exception-1/#post-6383176)
 * Redirects are a bit tricky. I mean the exception would simply be
 *     ```
       if (geoip_detect_is_ip_equal(geoip_detect2_get_client_ip(), 'some IPv4 or IPv6 adress)) {
        ...
       }
       ```
   
 * but to do the redirect properly you probably should let the user override your
   decision. Easiest via menu and you could save his choice as a cookie.
 *  Thread Starter [moonandfox](https://wordpress.org/support/users/moonandfox/)
 * (@moonandfox)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/create-an-exception-1/#post-6383191)
 * Ok, thanks! I’m building a site for a client in Costa Rica, who wants people 
   that are in Costa Rica to be directed to an alternate site. But, they want to
   be able to view the original site themselves! I think I will just have them go
   through a VPN to view their site.
 * Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Create an exception?’ is closed to new replies.

 * ![](https://ps.w.org/geoip-detect/assets/icon-256x256.jpg?rev=978998)
 * [Geolocation IP Detection](https://wordpress.org/plugins/geoip-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geoip-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geoip-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/geoip-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geoip-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geoip-detect/reviews/)

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * 2 replies
 * 2 participants
 * Last reply from: [moonandfox](https://wordpress.org/support/users/moonandfox/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/create-an-exception-1/#post-6383191)
 * Status: resolved