0

I am running WooCommerce and FacetWP on a WP 4.5 install.

I have set the permalink structure of the "Products" to the following, the custom taxonomy is a location based taxonomy.

/accommodation/%custom_taxonomy%

This generates links below, the second "paged" link refuses to work. https://noxrentals.feedmybeta.com/accommodation/camps-bay/ https://noxrentals.feedmybeta.com/accommodation/camps-bay/page/2/

I have checked the rewrite rules and i can see there are rules being generated to handle that rewrite. (see below)

[accommodation/([^/]+)/page/?([0-9]{1,})/?$] => index.php?area=$matches[1]&paged=$matches[2] 

I did notice that the following rewrite rule is also there, for the single products. What i think is happening is its trying to apply this rewrite, and fails. https://noxrentals.feedmybeta.com/accommodation/camps-bay/villa-blanca/

[accommodation/([^/]+)/([^/]+)/page/?([0-9]{1,})/?$] => index.php?area=$matches[1]&product=$matches[2]&paged=$matches[3] 

Is the order of the rules important?

Does WordPress stop stepping through the rules once it has found an applicable one? If so would moving the page rule I want, above the other rule to fix the problem? How would I do that?

1

1 Answer 1

1

The way htaccess rewrite works (wp uses this), this drives the very first match on the list to load the targeted rewrite of URL. So answer to your question is YES, keep longer/elaborated rules at top, followed by less longer structures; alternatively you can write conditions (rewrite cond ) to match rules per blockwise.

2
  • Thanks a mil, will try move / add another rule above the others, maybe that will work :-) Commented Apr 21, 2016 at 6:21
  • If it helps, remember to mark as answer; this helps others to quickly navigate to their quest - when needed. Similarly, try continuing discussion if suggested answer does not helps to what asked. Thanks Commented Apr 23, 2016 at 13:54

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.