0
votes

I'm stuck with this permalink structure in WordPress, I like to have some advice from the experts in the WordPress permalink area.

I'm building a website / shop with WordPress and Woocommerce. Both the latest versions.

If a leave the permalink structure default for the website and the shop all works fine.

But the default WordPress pages will have the link structure as:

http://www.myshop.com/?page_id=25

If I change the structure to /%postname%/ the website itself works great with page links like:

http://www.myshop.com/myinformationpage

But..

The Woocommerce part however is completely broken. The products page is ok with the overview of the first shop page but every product selection will end up in a 404 error.

This is also for category's, tags en even the shop cart payment pages.

What is the way to go here?

The best way for SEO is to change the basic permalink site setting to one of the none standaard settings. But what must be done to keep the WooCommerce shop working?

I don't want to remove the /shop/ or /products/ from the WooCommerce URL.

My settings:

Common Settings: /%postname%/

Optional: Product category base: ?product_cat= and Product tag base: ?product_tag=

Product permalink base: Custom base: /?product=

After a lot of trying i came up with the setting above. This will work for all WordPress content pages and most of the WooCommerce pages but the return after payment page is still broken.

Any input is welcome here.... thanks in advance!

1
I suspect you have something else going on because product permalinks work fine for me with /%postname%/ structure and /product as the base. Try disabling all your other plugins. Rename your .htaccess to something else and then resave your permalinks. Maybe that will help.helgatheviking

1 Answers

2
votes

After trying and changing the permalinks over and over again, removing the .htaccess and save the permalinks setting again, and all other tips ....

I finally found a post on wordpress.org. On the problem that the confirmation page that wat not found. (404)

[https://wordpress.org/support/topic/order-confirmation-page-not-found]

Adding this code to function.php did the trick.

function flush_rules(){
  flush_rewrite_rules();
}
add_action('init','flush_rules');

Thanks helgatheviking for your responce!