SID-00913: Map requested URLs (to ease interface with MS Project etc)
| Status: |
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
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.