1

I am using the Anonymous Redirect module to redirect example.com to example.com/login.

But when I refer a link like example.com/525?some=node/227 and log in, the url will be cut to example.com/525

I don't know why the url is cut after "?" or "&".

Any solutions for this one?

  • i think you need to use l() function. – DRUPWAY Dec 23 '15 at 10:25
3

Even though I haven't ever used the Anonymous Redirect module, I wouldn't be surprised if your "issue" is caused by the fact that this module does not support what you're trying to do.

However, as a possible alternative (as per your "Any solutions for this one?"), you may want to use the Rules module to perform the redirect you want to do. For an example of how to do so, refer to my answer to "How to redirect an anonymous user to the login form after a 403 error?" (the "option 2" part of it. Not sure what exact "Rules event" would fit in your case, but it'll be probably something related to a specific "path" in your site.

Not sure if it would fit your needs here also, but maybe you want to add the "Rules URL argument" module also to this. 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.

Refer to my answer to "How to use the Rules module to implement a custom redirect for an outdated URL?" for way more details about this module also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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