WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have spent the last few days working on and researching this question and have found no solution.

Basically I want to replace the query string which wordpress parses in order to query the database.

So for example, I want to say if the url is:


go to


I know I can setup fancy rewrite rules using the add_rewrite_rules filter, but this is over complicating the situation. I don't want to go down this route, all I want to do replace the exact request i.e. support/question with another/page

Is there a simple way to pass a different query string to wordpress?

share|improve this question
maybe htaccess redirect? – Bainternet Jul 18 '11 at 7:31

To at least answer the title of your question, the pre_get_posts filter may be useful. From the Codex:

This hook is called after the query variable object is created, but before the actual query is run.

The pre_get_posts action gives developers access to the $query object by reference (any changes you make to $query are made directly to the original object - no return value is necessary).

share|improve this answer

I am not sure if this is what you are looking for maybe you can try this plugin:


share|improve this answer

You can use simple JavaScript to achieve this:

<script type="text/javascript">    
    if ( window.location == "www.mysite.com/support/question" ) {   
        window.location = "www.mysite.com/another/page"     
share|improve this answer
This solution isn't SEO friendly, and causes an extra, unnecessary page load. JavaScript is rarely the right choice for redirects. – MathSmath Jun 10 '12 at 1:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.