I mean can we have something like this? url with double ? in drupal?


2 Answers 2


Sort of, but you'll need to URL encode the second ? otherwise the URL will be invalid.

The best thing to do is use l() or url() which will do this for you:

$query_string = array('destination' => 'xxx/yyy?token=zzz');
$url = url('<front>', array('query' => $query_string));

That will produce the string:


Which is the correctly encoded version of the URL in your question.

Drupal will also respect this method when auto-redirecting based on a form submission etc. So the page you get directed to will actually look like this:


You can do it like 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.