Seems there is a number of new people having issues with the Store Locator Plus® address lookup feature due to a failed REST API request. With Store Locator Plus 5 all address lookups are routed back through the WordPress site via the REST API in order to protect Google API keys.
If your site is running WordPress from a subdirectory you may run into issues if your web server is not configured to properly handle REST API routing. Especially if the site is using “pretty permalinks”, any Permalink setting under WordPress Settings | Permalinks other than “plain”.
The problem is that most of the Codex articles on the subject of doing a “WordPress in it’s own directory” installs came out well before the REST API existed. Most, dare we say ALL, have not been updated since and completely ignore the corner case of a WordPress subdirectory install with Permalinks enabled.
Permalinks REST API Rewrite Rule
Luckily you can fix this with a simple rule in your nginx website configuration via a rewrite rule. You can do the same with Apache, but you’ll have to figure out the proper Rewrite Conditionals to ensure you don’t rewrite everything. If you’re running subdirectory installs of WordPress we’ll assume you have a server admin that knows how to handle this.
Here is the partial Location matching rule and rewrite for the REST API with Permalinks enabled, assuming you’ve installed WordPress in a /wordpress/ subdirectory on your server:
location /wordpress/ {
rewrite ^/wordpress/wp-json/(.*?)$ /wordpress/index.php?rest_route=/$1 last;
}
Learn more at Lance’s technical blog about this issue.
Tired of web server configuration to keep your site running?
Our MySLP locator service doesn’t need all these special rewrite rules. We’ve bottled all the magic up in our JavaScript embed codes. You add your locations and adjust your map look-and-feel — then when you are ready past a JavaScript snippet into your website. It doesn’t even need to be running WordPress.
Advanced
- 150 Locations
- 1,000 Map Views
- Extra map views billed at $5/1000 views
- Basic locator styling
Professional
- 5,000 Locations
- 5,000 Map Views
- Extra map views billed at $5/1000 views
- Unlimited Categories
- GPS Location Sensor
- CSV import and export
- Full control over search form and results layout
- Map color scheme and element styling
- Feature locations
- Directory listings
Enterprise
- 15,000 Locations
- 8,000 Map Views
- Extra map views billed at $5/1000 views
- Unlimited Categories
- GPS Location Sensor
- CSV import and export
- Full control over search form and results layout
- Map color scheme and element styling
- Feature locations
- Directory listings
- Scheduled CSV Imports
- Advanced Reporting
- Territories
- Cluster Map Markers