Thanks for the reply John,<br><br>Tried this method, I was able to get the URL correct in drupal_goto, tried the same method of printing the URL it is being redirected to. All well till the variable is passed into the header, but it still doesnot redirect as required.<br>
It still continues to stuck in a loop, and doesn't get out of it.<br><br><br><div class="gmail_quote">On Fri, Apr 29, 2011 at 7:09 PM, John Morahan <span dir="ltr"><<a href="mailto:john.morahan@gmail.com">john.morahan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">drupal_not_found() sets $_REQUEST['destination'] which overrides drupal_goto, so you may need to unset it first. See for example <a href="http://api.drupal.org/api/drupal/modules--search--search.module/function/search_box_form_submit/6" target="_blank">http://api.drupal.org/api/drupal/modules--search--search.module/function/search_box_form_submit/6</a><div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On 29 April 2011 07:11, Vaibhav Jain <span dir="ltr"><<a href="mailto:in.vaibhavjain@gmail.com" target="_blank">in.vaibhavjain@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I used that Carl, and used the PHP code option. Got the same issue as when creating a custom callback.<div><div></div><div><br><br><div class="gmail_quote">On Fri, Apr 29, 2011 at 11:39 AM, Carl Wiedemann <span dir="ltr"><<a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You might consider <a href="http://drupal.org/project/customerror" target="_blank">http://drupal.org/project/customerror</a><div>
<div></div><div><br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 11:26 PM, Vaibhav Jain <span dir="ltr"><<a href="mailto:in.vaibhavjain@gmail.com" target="_blank">in.vaibhavjain@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello List,<br><br>I am trying to use drupal_goto and not able to use as I would like to.<br>
<br>I am trying to create a custom callback for 404 pages and redirect them to homepage.<br>
I know this can be done via drupal default mechanism, but my homepage is on panels, and have a condition check of drupal_is_front_page, so cannot be used.<br>
Also the URL does not change when we use default 404 mechanism.<br><br>Now, If I use drupal_goto('HOMEPAGE'), it stucks in a redirection loop, and it is never redirected to homepage.<br><br>I tried printing the output in common.inc, where this function is defined.<br>
On the very first line, i do get the correct path, but when it is passed in header, it changes to current url, and thus stucks in loop.<br>I also tried using the header function directly and it worked.<br><br>Is this some kind of bug in core, Or am i doing something really silly which i am not aware of.<br>
<br clear="all">Any help appreciated.<br><br>-- <br>Thanks,<br><font color="#888888">Vaibhav Jain<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br>Regards,<br><font color="#888888">Vaibhav Jain<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Vaibhav Jain<br>