[Xapian-discuss] Pretty URLs for omega?
xapian at catcons.co.uk
xapian at catcons.co.uk
Mon Apr 11 10:21:15 BST 2011
> -----Original Message-----
> From: James Aylett [mailto:james-xapian at tartarus.org]
> Sent: 09 April 2011 16:17
> To: <xapian at catcons.co.uk>
> Cc: xapian-discuss at lists.xapian.org
> Subject: Re: [Xapian-discuss] Pretty URLs for omega?
>
> On 9 Apr 2011, at 07:55, <xapian at catcons.co.uk>
> <xapian at catcons.co.uk> wrote:
>
> > How can the default omega URL be prettified?
>
>
> For apache I'd recommend using something like modwrite so
> that the external URL used by user agents is different to the
> scheme that the omega CGI uses. Alternatively you could
> probably use the Alias directive in some way to do something
> a little more simple (just /search acting instead of /cgi-bin/omega).
>
> If you aren't using apache, there will be similar approaches
> for your webserver. None of this requires changes to omega.
>
> Best,
> James
>
> --
> James Aylett
> talktorex.co.uk - xapian.org - devfort.com - spacelog.org
Thanks James :-)
Almost there.
Your suggestions focussed my Apache research. Using a Redirect directive
with Apache 2.2.16, the user friendly http://<host_ID>/search now takes the
user to http://<host_ID>/cgi-bin/omega?DB=<database_ID>. In case the
details are useful to anyone here's the actual Apache configuration file:
<VirtualHost *:80>
CustomLog "/var/log/apache2/xapian.access.log" combined
DocumentRoot "/srv/docoll"
<Directory "/srv/docoll">
AllowOverride None
Options All
Order Allow,Deny
Allow from all
</Directory>
<Directory "/usr/lib/cgi-bin/omega/omega/">
AllowOverride None
Options None
Order Allow,Deny
Allow from all
</Directory>
Redirect "/search" "/cgi-bin/omega?DB=docoll"
ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/omega/"
ServerAdmin <e-mail address hidden>
ServerName "Document Collation"
</VirtualHost>
That's perfect for the live system. For the development system we need to
use a port-based virtual host. It has to be port-based because there is no
local name resolution so the virtual hosts must be IP-based. The
development system works fine when accessed as
http://192.168.168.51/cgi-bin/omega?DB=docoll_dev&:8080 but I haven't been
able to set up a Redirect for http://<host_ID>/search_dev.
Using 'Redirect "/search_dev" "/cgi-bin/omega?DB=docoll_dev&:8080"' and
opening http://192.168.168.51/search_dev:8080 results in "The requested URL
/search_dev:8080 was not found on this server". Dropping the "&:8080" from
the Redirect is similar.
Best
Charles
More information about the Xapian-discuss
mailing list