Title: Request: Redirection based on city
Last modified: August 21, 2016

---

# Request: Redirection based on city

 *  [efromdc](https://wordpress.org/support/users/efromdc/)
 * (@efromdc)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/)
 * Since the api can direct what city the visitor is from, how about an admin section
   that says
 * If visitor is from city “x” redirect to this url => url
 * This would be awesome!
 * [https://wordpress.org/plugins/geo-my-wp/](https://wordpress.org/plugins/geo-my-wp/)

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

 *  Plugin Author [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * (@ninjew)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/#post-4591411)
 * Do you mean to redirect the user after he uses the “current location” widget?
 *  Thread Starter [efromdc](https://wordpress.org/support/users/efromdc/)
 * (@efromdc)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/#post-4591513)
 * No.
 * I mean a function that detects a visitors city upon visit to the homepage and
   redirects the user to a pre-assigned city based on the city detected.
 * In the admin section, a link could be called “geo-redirection” in the left menu.
 * That page allows the admin to
    1. Select a country / state / territory
    2. A second list is displayed showing the cities located in the selected country/
       state / territory
    3. A text box appears called “Visitors from this city redirect to what url?” which
       allows the admin to assign a url redirect based on the selected city
    4. Save
 * The result is when a visitor lands on the homepage and is from
    - Las Vegas, NV, they are redirected to [http://url.com/las-vegas](http://url.com/las-vegas)
 *  - Berlin, Germany > [http://url.com/berlin](http://url.com/berlin)
 *  - City not assigned > [http://url.com/](http://url.com/) (homepage)
 * Get it? Redirect a visit from the homepage based on the city 🙂
 *  Thread Starter [efromdc](https://wordpress.org/support/users/efromdc/)
 * (@efromdc)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/#post-4591526)
 * Hey Mr Fitoussi. Just wondering what you thought of my idea.
 * – efromdc
 *  Plugin Author [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * (@ninjew)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/#post-4591527)
 * Hi,
    Sorry for the delay but I do not always get notifications on new posts. 
   I randomly check this forum every few days. For the future you can post anything
   in [GEO my WP’s forum](http://geomywp.com/support/forums/) where I am more responsive.
 * As for your question, it will not be a very simple task since I will need to 
   build an admin part where admins will be able to enter more than a single option
   for redirection. It might be a nice idea for an add-on for the future.
    However,
   in the new coming version of GEO my Wp ( which I have a beta ready ) I added 
   a hook that fires right after the current location widget is being used. You 
   can use the hook with a simple function that will check the value of the city
   and redirect the user to a page based on that.
 * [Here](https://geomywp.com/blog/geo-wp-4-0-beta/) you can read more and download
   the new version

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

The topic ‘Request: Redirection based on city’ is closed to new replies.

 * ![](https://ps.w.org/geo-my-wp/assets/icon-256x256.gif?rev=2803407)
 * [GEO my WP](https://wordpress.org/plugins/geo-my-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geo-my-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geo-my-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/geo-my-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geo-my-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geo-my-wp/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/request-redirection-based-on-city-1/#post-4591527)
 * Status: not resolved