I'm using Drupal 7. I have about 120 urls with different query strings, and Drupal is not allowing me redirect on same url with different query strings/parameters.

For example:

I have to redirect from this url blog/its-time-occupy-it?page=1 to blog/its-time-occupy-it. See more example given below;

(from url) blog/about-author?page=1  -> (to url) blog/about-author
(from url) blog/about-author?page=2  -> (to url) blog/about-author
(from url) blog/about-author?page=3  -> (to url) blog/about-author

Any suggestions to give me solution to fix this issue?

  • What does it mean it doesn't allow you to? Some error message? And last but not least, have you considered doing it at Apache level?
    – Mołot
    Commented Feb 4, 2014 at 12:26
  • No I did not tried to do it on Apache level. I just go in Drupal 7 Configuration -> URL Redirect and "Add Redirect" to add url with different params. But it does not allow me to add. Yes I get error messages like you have already added redirect for this url. So the problem is, I want to add same url but with different uri params like ?page=1 and ?page=2 and more. Thanks for taking interest in this question. I will be waiting for your answer. I hope you will come up with solution. Thanks Smac Commented Feb 6, 2014 at 11:24

1 Answer 1


Using the Rules module you can implement a rule that looks like so:

{ "rules_redirect_all_node_aliases" : {
    "LABEL" : "Redirect all node aliases",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "init" : [] },
    "IF" : [
      { "text_matches" : {
          "text" : [ "site:current-page:path" ],
          "match" : "blog\/about-author?page",
          "operation" : "starts"
    "DO" : [
      { "redirect" : { "url" : "blog\/about-author" } }

It will redirect any path starting with blog\/about-author?page to a path named blog/about-author. So this will "redirect any such paths but with different query strings/parameters to the same url" (as in your question ...).

To experiment with this rule in your own site, just copy the entire Rules code above, and paste it in a new Rule in your own site, created via the "Import" function (available if you have the Rules UI enabled).

But wait, there is more ...

You could also check if page was specified as an URL argument. And make the actual value specified for such argument (like in your question: the 1, 2 or 3 after page=) available as a new variable to Rules. To do so, use the Rules URL Argument module. Here is a quote about it (from its project page):

... provides two rules conditions based on URL arguments:

  • check if a URL argument is present.
  • compare the value of an URL argument.

It also provides an action that makes the value of an URL argument available as new variable to Rules.

The newly provided Rules actions and conditions can be found under the "URL Argument" conditions and actions groups in the rules configuration interface.

For an example of how to use it, refer to Comment # 3 in issue # 1686360 which is about "Pass an amount to the url, ie; site/content/node-title?amount=10 or /node-title?=amount:10". Here is the relevant part of it:

  • add a "Check if URL argument exist" condition to your rule and set the "ARGUMENT" value to "amount".
  • add "Provide URL argument value" action to the rule and set "URL ARGUMENT NAME" value to "amount" and in the "Provided variables" section "ARGUMENT FROM URL - Variable name" to e.g. "amount_from_url".

You will now be able to use the amount value as a variable "amount-from-url" for other actions in this rule.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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