[pmwiki-users] ScriptUrl and login page

Patrick R. Michaud pmichaud at pobox.com
Tue Dec 12 14:54:53 CST 2006


On Mon, Dec 11, 2006 at 02:44:34PM -0800, T wrote:
> Hi,
> 
> I am trying to get through the problem of not being able to login
> to a wiki because the URL in login form action is not the URL set in
> the $ScriptUrl.
> 
> I found a closed (lack of feedback) PITS record that seemed close to my issue
> and added to it last week but so far that is not helping me make progress.
> 
> http://www.pmwiki.org/wiki/PITS/00337
> 
> 
> The platform is Solaris. I am not an administer of the Wiki Farm.
> I am using apache ProxyPass and $ScriptUrl to cause the wiki to appear on 
> another webserver. Seems to work fine till the incorrect login form action.
> 
> I am very hopeful this can be resolved because PM asserts
> "PmWiki always respects ScriptUrl" which, if could be made true,
> would fix this problem.

You're correct -- since I wrote that the authorization form
handling no longer respects $ScriptUrl.  Instead, the authorization
form is getting its action= value from whatever the server
provides in REQUEST_URI, which in this case isn't the true url
because your proxy and/or Apache are mucking it up and not preserving
it for PmWiki to use.  (The reason why PmWiki is using REQUEST_URI
here instead of $ScriptUrl is a long story, but has to do with
the many differences in the way browser and servers handle urls
in the action='' parameter.)

The short fix is to have the local/config.php file fixup
'REQUEST_URI' to look like we want.  So, in local/config.php, try:

    $_SERVER['REQUEST_URI'] = 
      preg_replace('/^[^?]*/', $ScriptUrl, $_SERVER['REQUEST_URI']);

This should replace the initial portion of REQUEST_URI with the
correct $ScriptUrl, and then everything may work after that.

Hope this helps,

Pm




More information about the pmwiki-users mailing list