Forums › Forums › Search & Filter Pro › URL Rewrite issue for pages with similar slugs
- This topic has 6 replies, 2 voices, and was last updated 10 years ago by Ross.
-
Anonymous(Private) August 20, 2014 at 6:48 pm #3810
After updating to the latest version I’m having a redirect issue that seems to relate to the template slug I define for a given search form.
For example if I use the slug “reports” and then I create a new page with the slug “reports-test” it will redirect to “reports”. If I change the slug to “test-reports” it renders the page correctly without the redirect.
It seems like when you rewrite the URL that the regex is maybe being too “greedy” if another page has a slug that starts with the same slug as a search form.
Ross Moderator(Private) August 27, 2014 at 10:49 pm #4034Hey Morgan,
Apologies for the late reply, after a huge amount of support requests recently I’m finally getting on top of it…
This sounds like a WP redirect thing – for example, if your page used to be called “reports-test”, and then you rename it “reports”, then WP will automatically rewrite this – so typing in “reports-test” will redirect to “reports” – so it may be that WP is being too greedy?
This plugin does not do any kind of rewriting where it would redirect a user to another page so find it difficult to think it would do this.
Have you made any progress with this?
Anonymous(Private) August 28, 2014 at 2:34 am #4054so I found if I added the ‘$’ end of string character to one of your rewrite rules the problem went away
i made this change to “class-search-filter.php” around line 140
from:
$newrules[$settings['page_slug']] = 'index.php?&sfid='.$base_id; //regular plain slug
to:
$newrules[$settings['page_slug'].'$'] = 'index.php?&sfid='.$base_id; //regular plain slug
thoughts?
Ross Moderator(Private) August 28, 2014 at 1:29 pm #4071Hmmm that is odd…. I’ll look in to it over the weekend – there are no redirects anywhere in the plugin so that is strange :/
Ross Moderator(Private) August 28, 2014 at 1:29 pm #4072Hmmm that is odd…. I’ll look in to it over the weekend – there are no redirects anywhere in the plugin so that is strange :/
Ross Moderator(Private) November 10, 2014 at 5:28 am #7287The latest update (later on today) will have your fix in it, thanks for that 🙂
-
AuthorPosts