1 (edited by RB 2009-07-19 14:40)

Topic: redirect_url

My site is divided into the 2 parts: main one and PunBB. In the main part, there is an authorization URL which leads to '/punbb/login.php'. As you know, this page generates "redirect_url" (hidden input value), which, in my case, could be either 'mysite.com' (if i came from 'mysite.com/[nothing_here_anymore]') or 'mysite.com/punbb/login.php' (if i came from 'mysite.com/[anything_but_punbb_folder]') -- btw, why is that?

Today, I have put 'ErrorDocument 404 /?404' in my '.htaccess'. Since then, "redirect_url" is 'mysite.com/index.php?404' (no matter where I come from; though, if I come from one of the punbb-page it's still OK and can be 'mysite.com/club/viewforum.php?id=1', for example), and the final URL is 'mysite.com/index.php?404&login=1' which is totally incorrect, of course.

What should I do to prevent this error?

Re: redirect_url

RB wrote:

As you know, this page generates "redirect_url" (hidden input value), which, in my case, could be either 'mysite.com' (if i came from 'mysite.com/[nothing_here_anymore]') or 'mysite.com/punbb/login.php' (if i came from 'mysite.com/[anything_but_punbb_folder]') -- btw, why is that?

What value the redirect_url should have in your situation? The redirect_url is a previous visited page.

3 (edited by RB 2009-07-20 10:40)

Re: redirect_url

If I come from 'mysite.com/news/1' (which is 'mysite.com/?news&id=$1' in dynamic form) the redirect_url transforms to 'mysite.com/index.php?news&id=1&login=1' which leads me to 404.

I do not let users to load any php-files from my server unless it's a '/punbb/*.php'. As a result, I do not understand why 'index.php' (and '&login=1', too) appears in the redirect_url in that case.

Re: redirect_url

RB wrote:

If I come from 'mysite.com/news/1' (which is 'mysite.com/?news&id=$1' in dynamic form) the redirect_url transforms to 'mysite.com/index.php?news&id=1&login=1' which leads me to 404.
I do not let users to load any php-files from my server unless it's a '/punbb/*.php'. As a result, I do not understand why 'index.php' (and '&login=1', too) appears in the redirect_url in that case.

That is correct. When you specify "mysite.com/?news&id=$1" in a dynamic form, you omit the part of page's name which goes before the question mark. The forum guesses the main page itself, that is "index.php", and regards the rest as parameters.
Try changing "mysite.com/?news&id=$1" for "mysite.com/news/?id=$1" or something similar, to make the forum reload to where required.