• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7582: Request Url from cfg script paths

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Request.pm Normal New   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


Whilst running TWIKI in IIS 7.5 I noticed that the origurl query string parameter was not being calculated correctly for returnable pages. The following result was returned from Request.pm -> url():



  1. All of my perl scripts are mapped with a *.pl extension. so this url would result in a 404 when trying to return to /twiki/tbin/view
  2. When the Engine.pm routine prepares the $req->path $ENV{REQUEST_URI} is undefined as environment variables are not defined in IIS. Thus it fallsback to manually constructing the path via the LocalSite.cfg variables. See Request.pm -> url();

The problem is Request.pm -> url() will only calculate using the fallback url using $TWiki::cfg{ScriptUrlPath} and $TWiki::cfg{ScriptUrlPaths}{ $this->action } and not include the $TWiki::cfg{ScriptSuffix}

I change twiki/data/Request.pm line the following to fix this occurrence :

    my $name =
      (defined $TWiki::cfg{ScriptUrlPaths}{ $this->action }
       ? $TWiki::cfg{ScriptUrlPaths}{ $this->action }
       : $TWiki::cfg{ScriptUrlPath} . '/' . $this->action)
      . $TWiki::cfg{ScriptSuffix};

  • PERL is not my primary language. Please make me aware of any optimizations or mistakes

  • This code is marked as not working for IIS. Though I believe my suggestion would fix it?

-- TWiki:Main/NolanSedley - 2014-10-23

Thanks Nolan. Although this fix works for IIS, I have a hunch that it breaks on Linux. It needs to be debugged and tested.

-- TWiki:Main.PeterThoeny - 2014-10-24

Of course. Let me know if I can be of any more assistance.

-- TWiki:Main.NolanSedley - 2014-10-24

Summary Request Url from cfg script paths
ReportedBy TWiki:Main.NolanSedley
Codebase 6.0.1
SVN Range TWiki-6.0.1-trunk, Sat, 18 Oct 2014, build 28296
AppliesTo Engine
Component Request.pm
Priority Normal
CurrentState New


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r4 - 2014-10-24 - NolanSedley
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback