Viewing 8 replies - 1 through 8 (of 8 total)
  • The current version does not allow this.
    We are going to be releasing an update today or tomorrow that has a new filter that will allow you to add your own check to the URL and bypass if desired.

    After the update, I will reply and show you how to add your own filter for this.

    Warm regards,
    Don

    Thread Starter emiliengerbois

    (@emiliengerbois)

    Hi Don and thank you so much for your quick reply,
    it seems like perfect timing ?? thank you for your help !!

    have a great day,
    emilien

    Emilien,
    The latest version is out (update when you can).
    After you do, here is what you need to do. Add the following to your functions.php file (or child theme functions file) after the opening <?php tag or before the closing ?> tag:

    function mycustom_qppr_filter_quickredirect_index( $index, $querydata ){
        if( $querydata != '' )
            return '';
        return $index;
    }
    add_filter( 'qppr_filter_quickredirect_index', 'mycustom_qppr_filter_quickredirect_index' );

    That is all you have to do. Then, any redirect you have set up that has a Query String parameter, will not be redirected. All others will.

    Warmest regards,
    Don

    Thread Starter emiliengerbois

    (@emiliengerbois)

    Hi Don,
    I hope you’re well, thank you so much for your answer here!
    I updated the plugin and added the function into my child theme file but I didn’t totally solved the issue.

    I guess my problem comes from a plugin designed for translation purposes: QTranslate X.

    Here’s my case:
    I have a page with base URL https://mywebsite.com/mypage.
    Trough QtranslateX, this url becomes dynamically https://mywebsite.com/lang/mypage (for example: https://mywebsite.com/it/mypage)

    Then, because of another plugin, I may have some parameters added to the URL and what I need, as I told you in the first place, is to redirect to another page unless a parameter is added.

    So, I need to have https://mywebsite.com/mypage redirected to https://mywebsite.com/my-other-page but https://mywebsite.com/mypage/?param=etc mustn’t be redirected.

    Problem is, even if I don’t take the parameter thing into account, I only get to redirect from page A to page B if I set it to meta redirect, in a regular rule from post edit page… 301 and Quick Redirects don’t work.

    I guess this issue comes from QTranslate X, and the way it adds the /lang/ to the URL when the page is loading.

    So if I set a regular redirect with meta option, it works, but I can’t exclude the URL with parameter from the redirection.

    What I’d like to do would be trying to use Quick Redirects and the function you gave me to exclude URLs with parameters from redirection rules, but I understood from your help section that those only are 301 unless we override them with filters… I think maybe that’s why I can’t get it to work… and I’d need to make Quick Redirects work as meta type, so that redirections would have a chance to work even if QTranslate X adds its /lang/ thing to the URLs.

    I’m not quite sure I made myself clear but I hope you’ll understand my problem here… sorry to bother you with such a situation… thank you very much anyway,

    Warm regards,
    emilien

    Let me look into this and see what I can come up with.
    Warm regards,
    Don

    Thread Starter emiliengerbois

    (@emiliengerbois)

    Thank you Don for your help and your responsiveness ! it’s awesome to have such a great plugin so well supported ??

    Got a Warning

    Warning: Missing argument 2 for mycustom_qppr_filter_quickredirect_index() in

    Warning: Missing argument 2 for ycustom_qppr_filter_quickredirect_index() in

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘redirect except if query string’ is closed to new replies.