How to remove the Destination parameter from an URL in Drupal 7? I have a blog posts, and when an anonymous user visits it and and clicks the link "Login" or "Register" to post comment (under blog entry), then its url looks like this:


  http://example.com/user/login?destination=node/55%23comment-form


But I don't want that parameter of destination here. I just want a simple link like so:


  http://example.com/user/login


Any suggestions?
Finally I got the solution by using hook_url_outbound_alter in my theme template. I tested it successfully.

function moon_url_outbound_alter(&amp;$path, &amp;$options, $original_path) {
 // here "moon" is my theme, use your own.
  switch ($path) {
  case 'user/login':
  unset( $options['query']['destination'] );
  break;
 }
}