Question
Currently, any user who goes to mywebsite.org automatically sees the "Main" web. Is there a way to configure TWiki so that they see "MyWeb" instead of the Main web?
I would like to do this INSIDE of TWiki- I'm trying to avoid using some kind of Apache redirect. I've checked
TWikiVariables and
TWikiPreferences, but I was unable to find anything there. I also checked in configure.pl - it's error free, and I don't think I should have to change the default webpage to refer to /bin/view.pl/MyWeb , as that seems kind of a weird hack.
Thanks.
Environment
--
MaxPar - 06 May 2008
Answer
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.
According to the comments in TWiki.pm:
If either the web or the topic is defined, will generate a full url (including web and topic). Otherwise will generate only up to the script name. An undefined web will default to the main web name.
So it's hard-coded -- not configurable. And further on, a slightly different description:
WARNING if there is no web specification (in the web or topic parameters) the web defaults to $TWiki::cfg{UsersWebName}. If there is no topic specification, or the topic is '0', the topic defaults to the web home topic name.
The line of code that does that (
$web ||= $cfg{UsersWebName}; ) is in a function that is used
a lot, so untolled things would break or work differently.
Compare that to the options you ruled out:
- Apache redirect:
Alias / "<Drive>:/<...>/bin/view/MyWeb/WebHome"
- Editing the default web page (index.html):
<html><head>
<META HTTP-EQUIV=Refresh CONTENT="0; URL=bin/view/MyWeb/WebHome">
</head>
Logging on... [that's only if you have a slow single sign-on, like NTLM]
</html>
--
SeanCMorgan - 06 May 2008
I hadn't though of looking in TWiki.pm for more info- thanks for pointing that out to me. You're right, it looks like just doing an Apache re-direct really is actually much easier.
In case anyone looking at this question at a later date is curious for what I did, I just added this to my .htaccess file in the root directory:
DirectoryIndex ./bin/view/DesiredHomeWeb/WebHome
--
MaxPar - 08 May 2008
Topic revision: r3 - 2008-05-08
- MaxPar