i used this code to redirect page to another

$new_path= 'http://localhost/mysite/print/194?0=' . $path;

but when requesting that page this error show up:

enter image description here

and the url in the address bar is:
but when i print the $new_path using drupal_set_message the url looks like correct one
Can you help me to solved it? thanks.

1 Answer 1


The biggest issue is that the query string should be passed in separate from the base URL itself, eg, it should be part of the $options array argument to drupal_goto(). Otherwise, as you've noticed, drupal_goto() doubles up a lot of times. If you fix that, I am fairly confident that you will get it to work.

Check out http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_goto/7 and http://api.drupal.org/api/drupal/includes%21common.inc/function/url/7 for more information on this.

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.