0

I'm stumped. I just installed an SSL certificate on a client's site which consists of a WooCommerce store section and regular WordPress pages. I am getting a 404 on every page of the site except for the homepage and main WooCommerce store page; product pages are also producing a 404.

I have migrated dozens of WordPress sites from HTTP -> HTTPS (on the same server) but this is the first one I've encountered with this behavior.

I deactivated WooCommerce and all pages began working normally over HTTPS; re-activate and all pages again produce a 404. Also, everything worked fine before the switch to HTTPS.

I'm thinking there is something custom related to Woocommerce in the theme that is returning a 404 during the loading of the page. Has anyone else experienced something like this or have any ideas?

2 Answers 2

0

With info provided, I can see a few things it might be:

Rewrites

Review your .htaccess rules, the rewrites (arguably) don't do a lot of work on the home page - which may be why your issue is inner-page only.

Run a flush or visit your wp-admin > Settings > Permalinks and [Save]. The rewrites which WooComm may be using may be doing something unexpected.

Database

It could be missed http database values (with WooComm) you can do a find and replace on the database. With wpcli you can see what's non-https with

wp search-replace 'http://example.com' 'https://example.com' --dry-ru

Theme

If you do believe it to be your theme, though unlikely unless custom theme, you can browse the source code of your theme and look for hard coded values, with command line:

grep -r 'http://' /path/to/wordpress/wp-content/themes/ 

Debug

Be sure to turn on WP_DEBUG and check your servers error logs incase the 404s are just hiding a simple php or setup error.

2
  • Thanks for the suggestions, I appreciate it. I have flushed the rewrites several times already, to no avail. I also did a search and replace on the DB when I converted to HTTPS. Nothing in the theme (purchased on ThemeForest from a third party who is no longer available) is hard coded to http. Finally, debug has been enabled all along and nothing at all is being written to debug.log. I have tried everything I can think of and so far the only thing that has worked is to disable WooCommerce which, for obvious reasons, isn't the answer.
    – ten9its
    Dec 19, 2017 at 22:22
  • besides wordpress's debug.log - how about your servers error log? If your on Apache with shared hosting it should be hosting control panel / plesk -> server errors. If you're on a vps it should be something like /var/log/apache2/error.log Dec 19, 2017 at 23:00
0

Problem solved.

Even though I had flushed the rewrites at least 10 times, going from default to custom and back again, I flushed it again this morning and all pages are working again.

I'm not sure WHY it took so long to refresh since there are no caching plugins installed yet... but it is working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.