[pmwiki-users] ScriptUrl and login page

T tejtm at operamail.com
Wed Dec 13 18:21:42 CST 2006


Patrick R. Michaud wrote:
> 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

that is working perfectly for me.  thanks





More information about the pmwiki-users mailing list