Tags:
url1Add my vote for this tag create new tag
view all tags
This is another version of ShorterURLs. It only works with http.conf as it requires the use of RewriteMap, and that's not permitted in .htaccess This version adds case-insensitivity. Basically it means that

http://www.ranjan.org/main/robnapier

does what it looks like.

First, save anycase (attached) somewhere. I need to think up a better name than that, but I've been in deep hack all night and am not thinking naming right now.

Then add this to httpd.conf:

RewriteEngine on
RewriteMap Anycase prg:/home/rnapier/bin/anycase

# If we used a script, topic or web name (any case), rewrite it
# Skip the root directory and anything already in the /twiki/ tree
RewriteCond %{REQUEST_FILENAME} !^/$
RewriteCond %{REQUEST_FILENAME} !/twiki/
RewriteCond ${Anycase:%{REQUEST_FILENAME}} (.+)
RewriteRule ^(.*)$ %1

Set $scriptUrlPath to '' in TWiki.cfg.

The anycase script has all the advantages of ShorterURLs and also adds case insensitivity (for webs and topics, not scripts). If no script is given, it defaults to viewauth (instead of view for the reasons explained in ShorterURLs [infinite loop]).

Case is properly preserved for non-existent topics (so that you get the right creation page). This system is also compatible with non-Twiki stuff in the same tree (which is my situation).

Anyway, I'll be trying it out on my users tomorrow. My hope is that it will improve my ability to say URLs to people and have them be able to find the page.

Changing the search system to be case insensitive should be pretty easy. This plus that change would pretty much make TWiki case insensitive without the complexities described in TopicCaseSensitivity.

-- RobNapier - 30 May 2002

I like this one and also ShorterURLs. I have noticed that my users are confused by mixed case spelling. And you are right, phone is hardle case sensitive device. Sorry I cannot contribute, but I will watch this page and will consider to put your code into my new site (which is not working yet).

For me, your advanced hacking skills are undistinguishable from magic!

-- PeterMasiar - 30 May 2002

I agree with Peter -- this is a great idea! Another one for the wishlist...

It reminds me of another issue that's more or less related to this one: It's not exactly user-friendly that the URL for Main.WebHome is Main/WebHome. Either use the slash in the text, or let the URL have the period.

The latter would be counterintuitive, but I see that the former could create strange situations too if you are talking about this/that item: there's no this web and no that page, or just consider fractions. Still, could someone estimate if this would be possible?

I realize that it would be a fairly big (tremendous?) change, but if usability is a goal then you can't really ignore it... I'd love to hear comments on this idea.

(I didn't create a separate topic for this thought, but you're welcome to move this to a new topic if you want to. (I can't think of a good topic name...   :-)))

-- TorbenGB - 04 Jun 2002

One thought though... If the major user base are TWiki veterans, then ShorterCaseInsensitiveURLs is probably a feature. If the user base has a significant amount of novices however, it's probably rather a trap.

The ShorterURLs idea is good because it leaves only the relevant parts in the URL, which is good microcontent. But the ShorterCaseInsensitiveURLs have a drawback: it does not give an accurate picture, since the topics are indeed case sensitive. This can lead to confusion, especially for novice users, and should be avoided.

-- TorbenGB - 07 Jun 2002

Torben makes a good point about confusing people, but perhaps not the people he's thinking. True novices (non-geeks) seem to find ShorterCaseInsensitiveURLs easier to understand, because they generally do not try to guess things from the URL and they never use the "Go" function. Much of this is because most of my users are not in persuit of WikiZen or the WikiEssence. They just want to see the latest updates to my projects and schedules and TWiki is handy for that. They never browse; they never write. They just follow links. It's the intermediate people, users who have tried to guess at how the system works without reading the docs, who get confused. That's not to belittle the problem, just to clarify it.

See WikiUserTypes for my discussion of kinds of Wiki users.

TWiki seems targeted at the WikiGeek and the WikiMaster. Tools like ShorterCaseInsensitiveURLs are intended to help the Reader and the Commenter. The group that none of the Wikis seem to target (and that ShorterCaseInsensitiveURLs doesn't help either) is the Writer. OTOH, total case insensitivity (TopicCaseSensitivity) would help everyone IMO and get rid of most of the issues that Torben suggests.

-- RobNapier - 18 Jun 2002

AbbreviatedWikiLinks4NicerUI which wants to become WikiL.4NicerUI wink

How about - giving an option to abbreviate WikiWord to WikiLink that has the shortest possible allias (made with authomatic abbreviation or manual user defined, like ColorToGrayGraphics to something like Rgb2GrayGfx) while keeping link description non-abreviated (a href="Rgb2GrayGfx" title="ColorToGrayGraphics")...

This would of course require adding new TWiki construct - WikiLink! But this would be usefull also for (non)collaborative bookmark managment and would go nice with recent change in EasierExternalLinking... Since external links are now with different syntax!

-- ZeljkoBlace - 05 July 2002

Thanks a lot for the script Rob, I've been using this for a long time and it makes the URLs so much nicer and shorter. I have a small problem with this though. Apache seems to cache the redirection map created by the anycase script. This probably speeds up handling the requests a lot but I have to restart Apache every time after adding new wikis, and we use a lot of small wikis so I have to do this way too often.

Is there any way of making Apache refresh the redirection map? Doing this by hand is getting too cumbersome.

-- HarriLakkala - 16 Sep 2005

I got this error on restart of Apache after trying to put this in. Any ideas ? Perhaps I need to include a special module to use the RewriteEngine command ?

Syntax error on line 1052 of /path/to/httpd.conf: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration

-- KeithHelfrich - 18 Jul 2006

Response to above: You need to add this to your httpd.conf - LoadModule rewrite_module modules/mod_rewrite.so

Question: Is this proven to work with TWiki 4?

-- AndrewRJones - 05 Sep 2006

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatext anycase r1 manage 1.2 K 2002-05-30 - 05:30 UnknownUser anycase script
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2007-02-17 - 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.