Support » Plugin: Quick Page/Post Redirect Plugin » Redirect with wildcard support for variable in url?

  • Resolved pakistan1


    I have the following use case:

    I have an incoming link (over which I have no control) that comes with some parameters:

    Problem is, the variables are variable (no pun intended), so that I would like to match /slug.html and whatever comes after to redirect to a page /slug/. Transferring the variables to the new URL is a plus, but I could live without it.

    Is there any wildcard support or ‘ignore whatever comes after a question mark’ already built into the plugin?

Viewing 1 replies (of 1 total)
  • The plugin does not have a wild card feature. It is designed for simple redirects, so it was intentionally left out.

    This is one of the cases where you would want to use something like .htaccess. A simple bit of code should work fine.

    The .htaccess file is in the root folder of your site (where the wp-config .php file is located). If you do not know how to edit your .htaccess file, search on Google, use a plugin like or read something like this tutorial

    I also want to point out that editing the htaccess file is at your own risk. It is the easiest way to achieve what you want to do, but doing it wrong can make your site not load – so be careful!

    Add this to the .htaccess file BEFORE any WordPress stuff you see like, # BEGIN WordPress:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    Redirect 301 /slug.html /slug/

    Change the word slug to the file name and the slug you will need changed. You can change 301 to 302 if you only want to return a temporary redirect response. That should redirect and keep the Query String data attached.


Viewing 1 replies (of 1 total)
  • The topic ‘Redirect with wildcard support for variable in url?’ is closed to new replies.