Question
this has been bugging me for two years: how to smoothly, silently and automatically redirect users (and search engines!) from
http://example.com/
to
http://example.com/bin/view/Main/
and I finally have the answer!
Environment
| TWiki version: |
any |
| TWiki plugins: |
n/a |
| Server OS: |
any unix |
| Web server: |
|
| Perl version: |
|
| Client OS: |
|
| Web Browser: |
|
--
MattWilkie - 10 Oct 2003
Answer
to automatically redirect from the top of your site to twiki (e.g. do away with the "lets get started page") , add the following to
bin/.htaccess, before the
blah blah files section:
<Files "index.html">
SetHandler cgi-script
allow from all
</Files>
and then symlink to view:
~/public_html $ ln -s cgi-bin/view index.html
Sorry, this doesn't work on Windows servers.
BTW, if you find yourself in the odd situtation where you can't turn off indexing on the bin directory (somebody points a browser to /cgi-bin/ and gets a directory listing instead of access denied) , create a symlink in the same way:
ln -s cgi-bin/view cgi-bin/index.html
PS: I think these instructions, or something resembling them, should be written in the TWiki distributin docs
PPS: I haven't tried it yet, but this may also point to a solution for ShorterURLs on hosted sites
--
MattWilkie - 10 Oct 2003
On any platform that supports
.htaccess, you can just edit the root
.htaccess and add a line like
Redirect permanent /index.htm http://yoursite.com/bin/view/Main/WebHome -- this way, you don't need any symlinks, and it works for all platforms...
--
TorbenGB - 16 Sep 2004
Maybe that should be in
.htaccess commented out and in the install guide as a suggestion.
--
SamHasler - 16 Sep 2004
Yes, I did this just now by edit .htaccess under my /twiki directory:
Redirect /twiki/index.html
http://mydomain.com/twiki/bin/view/Main/WebHome
It works!!
--
ChunhuaLiao - 13 Oct 2004
The Redirect command is not working for me.Is it possible that my Twiki (Cairo) installation (WIndows 2000 server, Apache) is not using .htaccess ? How do I find out ?
--
ChengappaCB - 23 Dec 2005
What I do is, inside the virtual host where I run TWiki:
<LocationMatch ^/$>
DirectoryIndex /bin/view
</LocationMatch>
When users browse to
http://your.domain.tld/
they get the Main.WebHome topic., without being redirected.
Or you can point it to wherever you want, putting e.g.
/bin/view/MyWeb as the
DirectoryIndex.
--
AntonioTerceiro - 23 Dec 2005
Redirect command in .htaccess did not work for me, as I am not making use of the file (as far as I know). Alternatively, I created an index.html with the lines:
<meta http-equiv="refresh" content="2; URL=http://twiki/bin/view/Sandbox/WebHome">
<h1>You will be redirected in 2 seconds. Please wait...</h1>
i think this suggestion was given by Peter Thoeny. Now when users type
http://twiki
, they are taken to the sandbox after 2 seconds.
--
ChengappaCB - 06 Jan 2006