Forums Forums Search & Filter Pro URL Rewrite issue for pages with similar slugs

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #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
    #4034

    Hey 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
    #4054

    so 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
    #4071

    Hmmm 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
    #4072

    Hmmm that is odd…. I’ll look in to it over the weekend – there are no redirects anywhere in the plugin so that is strange :/

    Anonymous
    #4082

    Thanks Ross .. yeah, i don’t think it is so much about redirects but rather the rewrite rules for the custom slug if a custom-template is being used

    Ross Moderator
    #7287

    The latest update (later on today) will have your fix in it, thanks for that 🙂

Viewing 7 posts - 1 through 7 (of 7 total)