create new tag
, view all tags

Consolidate Shorter URLs solutions for future Release?


Could TWiki be well served to put shorter-URL capability into the core in a future release?

Here's a list of places that may represent this demand:

All of these solutions appear to struggle with overcoming the existing limits of TWiki file-system layout to make URLs simple in all cases.

Note that most refer to Codev.CoolURIsDontChange as the directive for simple URLs. The original author of this (Codev.ConsolidateShorterURLs) topic requests simple URLs in the Codev.CoolURIsDontChange flavor as much (or more) for their mere simplicity in human understanding as their ability to remain static over time.

Support Case-Insensitivity?

A corollary problem: Case-insensitive URLs. This topic appears more controversial then "simple" URLs.


Here's my $.02 after trying to implement a brand-new TWiki site. I'm personally not comfortable trying out any of the, more-in-depth solutions that seem untested and not as simple as I would like (changes to the core scripts and other things). I have full root access for everything, so am not restricted by an ISP/Webhosting service, but am trying to minimize my admin efforts and focus more on using TWiki for my business.

For now, I'll be sticking (for now) with my simple solution found in the Question area of Support.HowToRemoveViewScriptFromURI.

Also: this is not a top priority for me, I just thought I would record it for future reference rather then letting it linger on my "todo" list. I'll have bigger fish to fry in TWiki world later if I can get to it...and I stick with TWiki. Also by starting these topics, I start to get a feel for what it's like to bring up real issues in a TWiki-like community, in a learn-the-game-by-trying sense. I hope no one takes offense to my messing around like this.

Another note: Am I duplicating a topic somewhere?

-- MattEngland - 14 Apr 2005

It would be good to have the url all lowercase. The topic names would translate to lowercase for the url. In most content management systems and weblogs the Topic/Articlename/entry is best in the url, and lowercase. Most have a system that does that auto. Would it be difficult?

-- BruceRProchnau - 15 Apr 2005

Another would be a - between-words-for-google, but I dare not bring that up. I want to live a little longer...lol

-- BruceRProchnau - 15 Apr 2005

I was in need for shorter URL on slion.net . Here is what I came up with without using mod_rewrite on my Ubuntu machine running apache2:

   #### Enables usage of shorter URL without =twiki= i.e. https://slion.net/bin/view 
   AliasMatch ^/bin(.*)$ "/var/www/slion/twiki/bin$1"
   AliasMatch ^/pub(.*)$ "/var/www/slion/twiki/pub$1"

   #### Enables usage of even shorter URL without =twiki/bin= i.e. https://slion.net/view 
   ScriptAliasMatch ^(/(attach|changes|configure|edit|login|logon|logos|manage|natlogon|natsearch|oops|passwd|preview|rdiff|rdiffauth|register|rename|resetpasswd|rest|save|search|statistics|upload|view|viewauth|viewfile)(.*)$) "/var/www/slion/twiki/bin$1"

If you add something like the above lines to your apache configuration make sure you run configure set {ScriptUrlPath} to / and {PubUrlPath} to /pub. Once its done you should be able to use all 3 forms of URLs http://mysite/twiki/bin/view, http://mysite/bin/view or http://mysite/view. Yet any internal link you click on a page will take you to the later and shorter URL. That scheme maintains support for longer URL in case you've been running a web site for sometimes and don't want to break existing links.

Notice that the ScriptAliasMatch lists every script you need to use from your bin directory. In our example we included the NatSkin scripts, you may want to remove those if you are not using NatSkin. However we exclude the TWiki.TWikiScripts#twiki as it conflicts with the twiki directory.

Now if you can't stand longer URLs anymore you may want to have a couple of RedirectMatch:

   ####Redirect to force shorter URLs
   RedirectMatch permanent ^/twiki/bin/(.*)$ https://slion.net/$1

   ####Redirect to force shorter URLs
   RedirectMatch permanent ^/bin/(.*)$ https://slion.net/$1

-- StephaneLenclud - 03 Mar 2007

Some plugins does not work with shorter urls if view/ is cutted off. TopicTranslationsPlugin (Bugs:Item3744) and RedirectPlugin for example.

-- SergejZnamenskij - 08 Mar 2007

I am using the shorter URLs with the view/ cut off (as in ShorterUrlCookbook) and am having no problems with RedirectPlugin. Not sure about TopicTranslationsPlugin though.

-- AndrewRJones - 09 Mar 2007

Thank yiu, Andrew. I see, it was my fault really. I have had to use the Rewrite engine, not Redirect. I have closed the bug report.

-- SergejZnamenskij - 10 Mar 2007

In the 4.1.2 distribution, the base href in the page will be wrong, which may lead to broken page-internal links. See Bugs:Item3968 for more information.

-- JoachimSchrod - 27 Apr 2007

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2008-09-15 - TWikiJanitor
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.