UUA Theme Service Plugin 404 errors when switching Site URL
webmaster@uufsd.org asked: The issue we’re having is that when we recently changed Site URL in the WP Settings fromhttp://uufsd.org/wp2 tohttp://uufsd.org, clicking a service results in a 404. If we switch the Site URL back, then the service links work again. The Service Plugin itself seems to still display services as does pages that show a list of services. The thing that doesn’t work is clicking on the service itself to see the details of the service. Using version 1.1.2 of the UUA Theme.
Comments (1)
Kevin Vess wrote:
I just went to your site and it looks like the services are linking to the correct URL (without /wp2 path). Also, the 404 error page looks like the one provided by your web hosting, not the theme. This may not be a WordPress issue but in fact a server issue. 1) Make sure your .htaccess file is configured properly. 2) Try to flush rewrite rules in my second answer below.
Margy wrote:
When you change the URL of a WordPress website, lots of links change. See this article (or search for “WordPress change URL” or “WordPress move from subdirectory”) for details of what you need to do.
Kevin Vess wrote:
If you’re comfortable running SQL Statements directly in your database, you could try running the following SQL Statements to find/replace all instances of your old URL:
https://gist.github.com/kevinvess/7686488
Important: before trying, please back up your database and files.
Margy wrote:
Interestingly, Dave Masser has the same issue and says, “If it was just the old services created before the switch that were having problems, using this update tool would make sense. But services created after the switch also 404. And it is only services, nothing else on the site has this behavior, which makes me think this isn’t a general WP issue, but something specific to how services work. Do you think re-installing the service plugin could help?”
Kevin Vess wrote:
Interesting– now I’m wondering if this is related to the `rewrite` argument passed to the register_post_type() function of the plugin (where it rewrites the plugin slug/URL for the services post-type). Specifically, the `with_front => false` argument.
Kevin Vess then wrote:
The other thing you could try– is to flush rewrite rules or permalinks (usually needs to be done manually for new custom post types) from the Dashboard:
- In the main menu find “Settings › Permalinks”
- Scroll down if needed and click “Save Changes”
- Rewrite rules and permalinks are flushed.
Kevin Vess also wrote:
The issue you’re experiencing is related to how your server is configured. It seems, you’re already using the /services path for something else and thus the web server returns a 404 error because the WordPress service URL does not exist within your current /services directory.
If you go to the following URL, you’ll see the web server directs you to some other website: http://uufsd.org/services
If you need support resolving this issue, email Vess Studio at: hello@vess.studio and we’d be happy to work with you to fix this.
Anonymous replied:
uufsd replied: Your answer solved the problem. Thanks!