WooCommerce - excelling eCommerce
[resolved] Permalinks not working with WooCommerce (7 posts)

  1. rickydwilson
    Posted 2 years ago #

    I am having issues with some pretty permalinks working OK (those that relate to Product) and others going to a themed 404 (those that relate to pages and posts).

    Have searched for quite some time on the forums but cannot find another similar incident (though no doubt there must be).

    I have woocommerce installed and am running TheRetailer theme (but I have the same problem with 2011 and 2012 WP theme). I have the latest versions of both installed. I use Bluehost as my host.

    When I disable all plug-ins permalinks work fine. When I only enable WooCommerce they stop working again.

    My website is http://www.cuddlesandpuddles.co.uk

    I have tested Mod_Rewrite. I think the tests below should also demonstrate that this doesn't look like the issue

    For ref - here is the .htaccess file that is generated when pretty permalinks are enabled (I wanted to use /%postname%/.

    # BEGIN WordPress
<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

    RewriteRule ^index\.php$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /index.php [L] </IfModule>

    # END WordPress

    Currently with using the Default settings

`# BEGIN WordPress
# END WordPress

    When I have permalinks set to Default the link for shop and products they look like this .... they work fine but are not what I want


    When I have permalinks set to anythng other than default (in my ideal case /%postname%/) the link for shop and products look like this .... and they work fine too (when I have pretty permalinks enabled of course) .... exactly what I want

    The issue is the Posts and Pages
    The standard Pages and Posts are accessible via Default settings but then broken i.e. goes to a theme designed 404 (not webhost 404) when Permalinks /%postname%/ is enabled e.g.

    Default: http://www.cuddlesandpuddles.co.uk/?page_id=828
    Permalink /%postname%/: http://www.cuddlesandpuddles.co.uk/blog/

    Default: http://www.cuddlesandpuddles.co.uk/?page_id=14
    Permalink /%postname%/: http://www.cuddlesandpuddles.co.uk/cart/
Default: http://www.cuddlesandpuddles.co.uk/?p=1608
    Permalink /%postname%/: http://www.cuddlesandpuddles.co.uk/test-2/

    In terms of plug-ins:
    I do not have any caching plug-in installed

    I do have Yoast SEO plug-in installed but have deactivated it whilst debugging and re-pushed the .htaccess files


  2. bheadrick
    Posted 2 years ago #

    I suggest using rewrite rules inspector to see which rules are being broken and why.

  3. rickydwilson
    Posted 2 years ago #

    Thanks bheadrick. WIll check this out

  4. rickydwilson
    Posted 2 years ago #

    So have installed and used the plug-in and switched to pretty permalinks to look at one of the problematic pages. http://www.cudddlesandpuddles.co.uk/blog/

    Output below.

    I can't make out though what it is telling me. I think it is saying that it has 1 match for the first "product" rewrite rule ... which I can't understand. Or indeed what to do about it.

    Rule Rewrite Source
    (.+?)/?$ index.php?product_cat=$matches[1] product
    (.?.+?)(/[0-9]+)?/?$ index.php?pagename=$matches[1]&page=$matches[2] page
    ([^/]+)(/[0-9]+)?/?$ index.php?name=$matches[1]&page=$matches[2] post

    Any help decoding the output and further suggestions gratefully received


  5. rickydwilson
    Posted 2 years ago #

    Have managed to resolve this. Not that I understand why, only the how!

    I needed to not just use /%product_cat%/ for the WooCommerce product permalinks but to either use one of their suggested formats or have a custom format with "something" to replace their suggested shop/ prepend to /%product_cat%/

    Then everything works fine. I used baby-gift and renamed the Shop page permalink to baby-gift thus giving me that which I needed.

    Now I only have Rewrite Rule Inspector gives one less matching rule:

    (.?.+?)(/[0-9]+)?/?$ index.php?pagename=$matches[1]&page=$matches[2] page
    ([^/]+)(/[0-9]+)?/?$ index.php?name=$matches[1]&page=$matches[2] post

    All good!


  6. gerygreen
    Posted 1 year ago #

    Hello, I use Theretailer too.
    Did you have any sales using this theme? I think it has a very hard to use checkout. don't you think?

  7. rickydwilson
    Posted 1 year ago #


    I found it OK. Granted I only use Paypal option so don't have the complications of other payment types.

    Customers have not mentioned any issues in terms of usability so pretty happy with it personally.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic