• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Base HREF is wrong when scripturls are changed

Some templates use %SCRIPTURL%/%SCRIPTNAME%/ to construct the base URL for this page. When one changes script-URLs (e.g., to get shorter URLs), that base URL is wrong and internal links fail.

Example case

Use a default 4.1.2 installation where URLs have been shortened according to the TWiki:TWiki.ShorterUrlCookbook.

Then a page will have the URL http://wiki.domain.tld/Web/TopicName. But page.pattern.tmpl will add the tag

   <base href="http://wiki.domain.tld/view/Web/TopicName"></base>
at the top of the page. This base href is used for topic-internal links, e.g., for the table of contents.

At best, this leads to a superfluous reload, since the internal links refer to a different URL (/view/Web/...) than that of the current page (/Web/...).

At worst, there is no RewriteRule/ScriptAlias for /view/ defined and all links in the table of contents cannot be resolved and lead to 404 not-found errors.

Proposed Solution

Use %SCRIPTURL{%SCRIPTNAME%}% instead. Every working scripturl setup has adapted $TWiki::cfg{ScriptUrlPaths}{view} or whatever script URL it changes.

Patch

I attach a patch to the 4.1.2 codebase that changes all existing base hrefs accordingly.

Remarks

I don't know if a bug in the distributed basic skins categorizes as Engine or Extension, so I leave it at Engine. smile

If you need an Internet-accessible 4.1.2 installation to test that bug (for some time), I can make that available.

-- TWiki:Main.JoachimSchrod - 27 Apr 2007

See my latest comment in TWiki:TWiki.ShorterUrlCookbook. It might serve as a permanent solution for short urls. smile

-- TWiki:Main/KwangErnLiew - 27 Apr 2007

Sorry, but AFAICS your comments are not relevant for this bug: you still keep the /view action prefix in your proposal, i.e., you just work without .../bin prefix in front of /view. This bug is about wrong base hrefs if you have discarded the /view prefix, too.

-- TWiki:Main.JoachimSchrod - 27 Apr 2007

Thanks Joachimn, I applied your patch on MAIN branch (for 4.2)

CC

ItemTemplate
Summary Base HREF is wrong when scripturls are changed
ReportedBy TWiki:Main.JoachimSchrod
Codebase 4.1.2
SVN Range

AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:14126
TargetRelease minor
ReleasedIn

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch twiki-4.1.2-scripturl.patch r1 manage 3.3 K 2007-04-27 - 11:47 JoachimSchrod Patch to templates to get base hrefs right when scripturls have changed
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback