Title: IP based redirection is not working
Last modified: August 17, 2021

---

# IP based redirection is not working

 *  Resolved [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/)
 * Hi,
 * I am using “LiteSpeed Cache” plugin. Also, I am using “WP Geo IP” Redirect Plugin.
 * Before using “LiteSpeed Cache” plugin, “WP Geo IP” Redirect was working fine.
   After Installing “LiteSpeed Cache” Plugin “WP Geo IP” Redirect is not working
   properly.
 * I have Set redirection on Submenu of Services(MBA/eMBA/MS) menu.
 * Pl. check
 * Regards,
    Sandeep Pal
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fip-based-redirection-is-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14778016)
 * if your site is using CloudFlare, then add this at top of your .htaccess
 *     ```
       <IfModule LiteSpeed>
       RewriteRule .* - [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]
       </IfModule>
       ```
   
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14780730)
 * Hi,
 * Thanks for your reply. Right now I am not using “CloudFlare” Plugin. What else
   can we do to resolve the problem? pl.help.
 * Regards,
    Sandeep
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14780736)
 * you will need to have certain service that gives you the geoip information , 
   like CloudFlare CDN , or GeoIP module on your server
 * is it shared hosting ? or your own server ?
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14780902)
 * Hi,
 * Its shared hosting.
 * Regards,
    Sandeep Pal
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14782129)
 * Hi,
 * if you don’t use any CDN service , then you will need to ask your provider to
   enable [GeoIP](https://docs.litespeedtech.com/cp/cpanel/geoip/) module for you,
   otherwise there is no way out
 * Best regards,
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14805995)
 * Hi,
 * GeoIP module has enabled. But still problem not resolved. I have set redirection
   for India. Its working for India. But its not working properly for Non- Indian
   Countries.
 * Pl. help
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806007)
 * Can I still have to add
 * <IfModule LiteSpeed>
    RewriteRule .* – [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]
   </IfModule>
 * into .htaccess
 * or something else?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806009)
 * that rule only works if you have CloudFalre CDN enabeld
 * —-
 * sorry didn’t see your first reply
 * if you have geoip enabled, then use
 *     ```
       <IfModule LiteSpeed>
       GeoIPEnable On
       RewriteRule .* - [E=Cache-Control:vary=%{ENV:GEOIP_COUNTRY_CODE}]
       </IfModule>
       ```
   
 * if it didn’t work , please create a phpinfo page, and make sure you see `GEOIP_COUNTRY_CODE`
   variable in phpinfo page.
 * that is the indication if geoip works or not.
    -  This reply was modified 4 years, 9 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806025)
 * Can I ask them to enable CloudFlare CDN instead of Geo IP Module?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806030)
 * if this is your site [https://mbaadmissiongurus.com/staging/mba-admission-services/](https://mbaadmissiongurus.com/staging/mba-admission-services/)
 * it has CloudFlare already
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806071)
 * Since GeoIP module is enabled and CloudFlare is already there. Will they conflict?
   or will I disabled one of them?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14806073)
 * they should not conflict , but for efficiency concern , can use CF one only
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14810017)
 * Hi,
 * Is there any difference between CloudFlare nameserve and CloudFlare CDN? CloudFlare
   nameserve is Active. Can I activate Cloudflare CDN also?
 *  Thread Starter [sandeeppal1](https://wordpress.org/support/users/sandeeppal1/)
 * (@sandeeppal1)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14810309)
 * Also, I did as you said but still not resolved. I have set redirection for India.
   It’s working for India. But for Non-India country some of the url redirecting
   to India pages.
 * Please find the below links
 *     ```
       https://mbaadmissiongurus.com/staging/start-to-finish-mba-emba/
       https://mbaadmissiongurus.com/staging/ms-business-management-specialties/
       https://mbaadmissiongurus.com/staging/non-gre-gmat-admissions-mba-ms/
       https://mbaadmissiongurus.com/staging/interview-preparation/
       https://mbaadmissiongurus.com/staging/pre-application-planning/
       https://mbaadmissiongurus.com/staging/personal-statement-writing/
       https://mbaadmissiongurus.com/staging/essays-reviews-writing-consult/
       https://mbaadmissiongurus.com/staging/resume-reviews-consult-writing/
       https://mbaadmissiongurus.com/staging/recommendation-letters-writing-reviews/
       ```
   
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14810376)
 * One is DNS, one is CDN
 * You have CDN enabled already

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

The topic ‘IP based redirection is not working’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/ip-based-redirection-is-not-working/#post-14810376)
 * Status: resolved