This question about Installation of Foswiki: Answered
Remove /bin/ from the URL?
I'd like to remove the
/bin
part from the URL, so it would end up like
http://example.com/view/Web/TopicName. The
view
bit makes sense but could also be removed for user convenience (but still show
edit
etc.).
A very simple approach would be to just
move all files from /bin/ to the root instead, and fix whatever files point to /bin/.
Why should I not do this? Why isn't that the default anyway?
A more complicated approach is using some kind of ShorterURLs solution that I've seen on TWiki but never made it work on my own installations (not for lack of trying; possibly for lack of grok).
--
TorbenGB - 05 May 2010
Answer
Hi Torben,
You could do something like:
ScriptAlias / /var/www/fosiki/bin/
Or you could use shorter URLs, as you pointed. Try
ShorterUrlCookbook.
ApacheConfigGenerator also has support for shorter URLs.
--
GilmarSantosJr - 05 May 2010
Thank you for the input! But if I understand correctly, these solutions all rely on having write access to
httpd.conf
-- I'd like to use this on a hosted install where I can't edit
httpd.conf
, hence my idea to not use redirects but
actually move the files in question.
Why should I not do this?
--
TorbenGB - 06 May 2010
Well, I'd not recommend you to do this: you would have to add, at least,
Option +ExecCGI
to foswiki root and I can't imagine a happy end for this kind of thing and also the part that you correct the paths is very error-prone and it'd be difficult to update.
I use Short URLs using only
.htaccess
:
Put this in you root directory domain:
RewriteEngine On
RewriteRule ^([A-Z].*) /path/to/your/domain/root/bin/view/$1 [L]
DirectoryIndex /bin/view
Notice it only works if your webs begin with capital letter.
--
GilmarSantosJr - 07 May 2010
Wow, that is a fabulously simple recipe! Oddly, the redirect works but the content is shown
entirely without CSS. (Topic formatting, edit functionality, old longer URLs all still work.) My installation contains only Foswiki (in the root, so my
/path/to/your/domain/
is actually just
/
), and I've not added any non-Foswiki directories that start with a capital letter.
What can cause this error?
Thank you also for the explanation why the actual
bin
files shouldn't be in the root - that makes sense.
--
TorbenGB - 07 May 2010
Not exactly...
path/to/your/root/domain
refers to
physical path, not URL path... so it'd be something like
/home/foo/domain.com/
(using dreamhost).
Also, check your
configure
settings like
{PubUrl}
. Another approach to figure out what is happening is to request directly some css file (check the URL at page source) and look at the error.log what went wrong...
Please, report if it works
--
GilmarSantosJr - 07 May 2010
Ah, the physical path, that sounds promising and I didn't try that. I'll test that in the next few days and report back!
Configure
settings: you mean I should shorten the
bin
away from there too? I guess I wouldn't touch the
pub
directory though, so I'm not sure what I should check for.
--
TorbenGB - 07 May 2010