Tags:
create new tag
view all tags
We've recently noticed the use of the BASE tag in the TWiki templates. This sometimes causes problems and we can't work out why it's needed, given that relative URLs should resolve correctly without it.

-- JohnTalintyre - 06 Apr 2001

Good question. I guess we can drop the BASE tag unless there are problems with certain environments (i.e. browsers). The reason why it is in, is to have working links and images for locally saved pages (it is questionable if this is used at all)

What kind of problems do you encounter with the BASE tag?

-- PeterThoeny - 06 Apr 2001

We've got two areas of possibly problems - neither confirmed yet.

  1. Certificates - depending on request URL/browser, the certificate dialogue box can appear several times for a page (once for each image)
  2. People using a TCP/IP proxy/tunnel - ports get mucked up

I'm not sure I understand about the locally stored files - isn't BASE just used to get relative links to point to another server?

-- JohnTalintyre - 07 Apr 2001

Locally stored files: Say, you visit a web page and use the browser "Save as..." function to store the page locally. All links work in the local HTML file in case the page has a BASE tag, if not your relative links end up in Nirvana. It is questionable if this ever gets used with TWiki pages, so it probably does not apply.

-- PeterThoeny - 07 Apr 2001

Actually, I tried to create a local copy of a wiki web with http://www.gnu.org/software/wget/ -- and failed frown While all pages are "there", every link leads back to the originating site. That's the <BASE...> tag feature. But removing it won't help: all twiki links are absolute, i.e. start with sth. like /twiki/bin/view/.... Obviously, this can't work on your local box, where your browser prepends file://localhost/mirror/dir.

My proposal:

Make all twiki links relative, e.g.: ../Support/WebHome for the support pages. or ../../edit/Codev/WhyBaseTag to edit this page. Benefits:

  • mirroring sites gets easier
  • save quite a few bytes in links (for this page I calculated 300 of 6000 bytes ~ 5%)
  • you could get rid of the ugly, implementation dependent /cgi-bin/view/... URLs with mappings in your web server configuration like Support/ -> /twiki/bin/view/Support/ or edit/Support/ -> /twiki/bin/edit/Support/ See "Url as UI" http://www.useit.com/alertbox/990321.html

-- PeterKlausner - 09 Apr 2001

I am working with John Talintyre - using the <BASE...> tag per the standard install seems to cause https to re-request the client certificate on every link (ie. each gif, js and css). This is quite painful as we have 12-13 links per page with a new skin... frown This is the case with IE5.5 and NS4.

Even when the base tag is removed, NS4 requests the certificate 3 times - I suspect that it is authenticating against each of the absolute paths. Perhaps Peter's suggestion would fix this???

-- SteveRoe - 09 Apr 2001

I tried to remove the BASE tag and found a problem with that. TWiki acceps incomplete URIs, e.g. you can omit the topic name and you will get WebHome, and you can omit also the web name and you get the Main. So https://twiki.org/cgi-bin/view/ shows the TWiki home. In case you take out the BASE tag you need to make sure that all links in the page are absolute; it is most of the time, but not for the { Home | Changes ... } links in the header. So either remove the BASE tag and make all links absolute, or keep the BASE tag and allow relative links.

-- PeterThoeny - 16 Apr 2001

OK - this is now working fine for our SSL/certificate mode - we have currently taken the approach of stripping the tag and keeping all the links absolute. We have built a fancy skin that replaces the { Home | Changes } WEBTOPICLIST with a real navigation bar (see BetterSkins for more on this), thus avoiding the pitfall you mention. It behaves properly for truncated web & topic names.

I expect that this could also be made to work with a combination of and relative also (this would be a bit cleaner if we had a %HOSTURL% wikivariable as things like gifs are not in the SCRIPTURL path - but that is another story).

-- SteveRoe - 20 Apr 2001

The source of this page shows three variants of links:

  1. absolute URLs like http://twiki.org/cgi-bin/view/Main/ in the navbar -- obviously, these work always, but not always like you want.
  2. relative URLs like WebChanges -- these work always, and always as you would expect.
  3. relative URLs with an absolute Path in it like /cgi-bin/view/Main/WebHome -- these work
    • if you provide the <BASE... tag -- then it is basically like an absolute URL
    • without <BASE... tag it works only in a web server environment with identical setup
Therefore, strictly relative URLs (without absolute Path!) seem to be the best solution.
Am I overlooking something?
What was the reason for using absolute paths in the first place??
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2001-09-28 - MikeMannix
 
  • 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.