I ended up solving this with a little bit of code (in the form of a plugin):
if(isset($_GET['state']) OR isset($_GET['city'])) {
$url = explode("https://wordpress.stackexchange.com/", $_SERVER['REQUEST_URI']);
$url = end($url);
$_SERVER['REQUEST_URI'] = "https://wordpress.stackexchange.com/" . $url;
}
This code in essence removes the “/arizona/” or “/arizona/phoenix/” from the REQUEST_URI global variable and replaces it with “https://wordpress.stackexchange.com/”, which then forces WP to serve up the front page template using index.php. Fixed!
Perhaps a few of you can vote this answer up for me. 🙂
Related Posts:
- Newbie question: no index.php? in my plain wordpress permalink
- Remove query string specific key value
- Dynamic content based on a URL parameter
- Create custom permalinks to show Custom Post Type’s relationship?
- How do i add slugs to a URL, but still redirecting to the same page
- Nginx WordPress and another Web app URL structure
- Why is home page content not displaying with this rewrite rule?
- How to deal with a GET variable of ‘name’?
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Current WordPress Page Title as Search Parameter into A Tag
- How does one make a URL return dynamic JSON with custom Content Type?
- Build a content and excerpt grid loop with paging and options for # of posts
- Query two taxonomies via URL or link?
- Trim first 2 words of the exceprt
- Display Post co-authored in Author Page
- How is WordPress manipulating the posts like there are folders?
- Sorting Posts | Alphabetical Order
- Looking for most performant way to execute several similar WP queries within shortcodes
- Get the last month with posts using a recursive function…
- Rename “Portfolio” slug?
- How to query for pages/post depending on slug?
- How to use an associative array in post__in with WP_Query?
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Display a specific category of products in shop page and disable code for specific actions
- Append query string to all URL’s
- custom rewrite rule help! Custom rewrite rules not applying to custom post type
- WordPress, AJAX and pre_get_posts using conditional tags
- Use URL Rewrite as well as $_GET parameters in URL?
- Exclude posts based on meta value
- Custom query, checking values of multiple meta keys
- Loading index.php contents which located outside blog folder for post single page
- Remove echo from shortcode
- Search Query: how to construct a search string from two select elements?
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Help with .htaccess and Login with Subfolders
- Redirect to another page using contact form 7? [closed]
- Is it possible to retrieve all posts with a certain value for metadata?
- unable to use ‘new WP_Query’ in AJAX call
- How to check if the current page is at a specified path in the URL?
- Get all posts as an array ID => Name
- How to hide posts of a specific custom category in WordPress?
- I’m unable to call img path using single quotes in an array?
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- WordPress WP_Query without query GET parameters
- Dividing the loop to style post differently
- Displaying Event within two given time frames
- Adding custom url to readmore link using get_permalink()
- How to set base url for php widget
- displaying a fall back query if there’s nothing in the post-type category
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- WordPress permalink issue
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- Output product category link from WP_Query
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Passing in MySQL prepare statement parameter separately throwing error
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Load more posts using AJAX based on posts inside WP_Query
- Custom search query on WordPress page not working
- How to select post ID for given parent name with nested prepared queries?
- posts_per_page displays only 2 posts instead of 4 posts
- WP_QUERY post_in problem
- how to get data from two different table from wordpress database
- Assign meta_query value to php variable
- Need to show 7 posts from actual date
- Add code to the header of posts by particular author
- Paged WP_Query is quitting on page 3
- Get Child of Child Pages in custom Menu
- WordPress search query, how to modify the sql
- Modify post image in full size
- Meta query not showing result properly
- How does WordPress rewrite URLS using its PHP scripts
- WordPress add_rewrite_rule
- Help on Wp_query to print an term
- Add custom taxonomy to custom search for posts
- making a search.php query
- How do I generate formatted permalinks as specified in backend options?
- My query keeps looping infinitely ! how to stop it?
- Efficient way of querying for a “fallback” post?
- Previewing/Updating some Pages causes “The requested URL was rejected” Error
- Create a hierarchical loop at predefined markup requirements
- extract url from a hyperlinked string in PHP [closed]
- Query seems to be duplicated
- Retrieve first image url from custom post with pagination
- Difference in Get Variable Location
- WP Query conflict on tag.php and category.php template
- Get current WordPress page then add #post ID to the end
- Dynamically append custom post type to end of url
- Keeping the previous get value and add another value when submitted
- Pagination in category.php not functioning
- WP query with variables gives no result for specific user
- Display all categories (with link) of custom post type – WordPress
- Custom taxonomy with page post type – WordPress
- How to sort custom sortable column by custom table value
- /page/2/ redirect to 404
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Create a custom plugin with dynamic child pages listing database records