2

I purchased a Wordpress template, which comes with a custom, and very nice, shop page. The problem is that actually I can't set the permalink to be www.example.com/shop/ because it is the default WooCommerce shop page link, so I decided to edit the permalink to www.mysite.com/my-shop/ but that's not what I want.

Moreover, at any time, I have two different Shop pages existing: the www.example.com/my-shop/ page and the default WooCommerce shop page at www.example.com/shop/

I tried to edit WooCommerce shop page in WooCommerce->Settings->Product->Display forcing the shop page to point to my custom page, but it actually overwrite my custom shop page with WooCommerce's one.

So if I go to www.example.com/my-shop/ it actually shows Woocommerce page...

How can I solve this problem?

Thanks.

LoicTheAztec
  • 207,510
  • 22
  • 296
  • 340
Yuri
  • 2,961
  • 3
  • 26
  • 46
  • 4
    I'm voting to close this question as off-topic because it's not programming related. You can try WordPress Development, but that's a site for developers too. – Erik A Jan 06 '18 at 09:56
  • I was guessing there was some sort of page replacement instruction to be run on my child-theme, so almost programming related.. The answer is related to .htaccess, therefore programming. – Yuri Jan 08 '18 at 15:02
  • Note that the main reason I'm closing your question is as a perparation to the [possible shop burnination](https://meta.stackoverflow.com/questions/361501/sorry-the-shop-is-closed). The `.htaccess` part is a dupe of https://stackoverflow.com/questions/16388959/url-rewriting-with-php, but I found this was more apt. – Erik A Jan 08 '18 at 15:08

1 Answers1

3

I had this problem too with a custom shop page, and I have solve it with an htaccess rewriting rule. You can keep woocommerce shop page.

Then add something like this on your htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RedirectMatch permanent /shop* http://www.example.com/my-shop/
    # Then here below goes Wordpress rules and others…
</IfModule>

I hope this will help.

The advantage is that I have a better SEO (as it's a custom shop page) like a normal page.
The WooCommerce shop page still exist but it's an empty page (no shortcode in it). Everything works perfect. In my menu (navigation) I have this Custom shop page link. If WooCommerce shop page is called from a link in product pages, the redirection is stunning straightforward.

LoicTheAztec
  • 207,510
  • 22
  • 296
  • 340
  • Thank you for correcting my post. I will keep this as last chance, as I wouldn't like to deal with WP .htaccess – Yuri Aug 13 '16 at 18:37