Tags:
create new tag
view all tags

SID-00913: Map requested URLs (to ease interface with MS Project etc)

Status: Answered Answered TWiki version: 4.1.2 Perl version: 5.8.8-12ubuntu0.4
Category: CategoryDeployment Server OS: Ubuntu 8.04 Last update: 15 years ago

We have sets of pages of the form http://twikipath/bin/view/Main/ProductNameDocumentName

We use MS Project to track products, and it allows a base URL to be set- for example: http://twikipath/bin/view/Main/ProductName/

and each task can then be given as a relative link "DocumentName".

Clicking on the resulting hyperlink opens http://twikipath/bin/view/Main/ProductName/DocumentName (with a '/' between ProductName and DocumentName)

It does not appear to be possible to remove the '/', and TWiki quite rightly complains that there is no ProductName web.

Is there a way to map these URLs so that a request for http://twikipath/bin/view/Main/ProductName/DocumentName actually gets: http://twikipath/bin/view/Main/ProductNameDocumentName

I've seen some use of apache mapping previously to shorten TWiki URLs etc, but not sure if this is possible?

-- NigelOrr - 2010-07-26

Discussion and Answer

After a quick look at mod_rewrite, found a solution with RedirectMatch- e.g. add the following to /etc/apache2/conf.d/twiki.conf

# shortcut to single file called DocumentRootNameProjectName 
# http://wiki-server/DocumentType/ProjectName/TopLevel 
# points to 
# http://wiki-server/cgi-bin-twiki/view/Main/DocumentRootNameProjectName 
RedirectMatch /DocumentType/(([A-Z].*)?)/TopLevel?$ http://wiki-server/cgi-bin/twiki/view/Main/DocumentRootName$1 
# shortcut to set of files with common root name 
# http://wiki-server/DocumentType/ProjectName/DocumentName= 
# points to 
# http://wiki-server/cgi-bin-twiki/view/Main/DocumentRootNameProjectNameDocumentName 
RedirectMatch /DocumentType/(([A-Z].*)?)/(([A-Z].*)?)?$ http://wiki-server/cgi-bin/twiki/view/Main/DocumentRootName$1$3

Hope that is useful to others

-- NigelOrr - 2010-07-27

I am glad you fond a solution, and thanks for sharing! Yes, Apache redirects have many uses.

-- PeterThoeny - 2010-07-27

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Map requested URLs (to ease interface with MS Project etc)
SupportCategory CategoryDeployment
TWiki version 4.1.2
Server OS Ubuntu 8.04
Web server apache2 2.2.8-1ubuntu0.14
Perl version 5.8.8-12ubuntu0.4
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2010-07-27 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.