----------
From: "Umesh R. Patil" upatil@bigfoot.com
To: "'java-apache-users@list.working-dogs.com'" java-apache-users@list.working-dogs.com
Subject: / alias
Date: Thu, Mar 11, 1999, 10:48 AM
URL rewriting may be a solution for you:
At the end of httpd.conf add:
-----------------------------
/IfModule
LoadModule rewrite_module modules/ApacheModuleRewrite.dll
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/(.*) /myZone/slash?data=$1 [PT]
/IfModule
What this does is rewrite urls so that your servlet gets invoked
with anything following the first slash in the URI.
I haven't tested this but it could get you going...
Umesh.
On Thursday, March 11, 1999 9:05 AM, John Frailey [SMTP:john@ecstreet.com]
wrote:
> This may sound like a simple request... but I am having all kinds of trouble
> figuring
> out a way to do this:
>
> we host many sites. we build the same servlets that are used among many
> sites.
> depending on the site, we may write to different database tables, or perfom
> different reads from files or db.
>
> my problem is this... I am trying to make a url that looks clean. that is
> just our
> domain, and then the hosted customer name like so:
> http://ourdomain.com/abc
> http://ourdomain.com/xyz
>
> I want to make my servlet aliased to /
> this would allow me to parse the abc and xyz appropriately. I realize
> that all
> request at that domain will go through that servlet. thats ok. I have set up
> a domain
> just for that reason.
>
> I have set up a zone called slash with a mounting point of / but it seams
> that the
> alias name starts after the slash. I use several different servlet engines,
> (all with
> apache) and can accomplish this with what they call a mapping. (Jrun term)
> Set up
> a map for my servlet name ie ( store.class -> /) to slash.
>
> Is there any idea's on how to get this same functionality with jserv.
> Everything else
> works so good... I they really did a great job of cleaning up the install...
> went
> perfect first time through...
>
> Thanks for any ideas...
>
> p.s. we also offer another option to our cust. that let them get a dns
> entry. this would
> then look like :
> abc.ourdomain.com/store (servlet here is store)
> but this requires a new dns entry, and a KILHUP on dns. we would like to
> have a realtime, non disruptive way like above for an alternative...
|
----------
From: Jonathan Tew jtew@bpsinfo.com
To: Java Apache Users java-apache-users@list.working-dogs.com
Subject: Re: Way to make all urls go through one servlet?
Date: Wed, Sep 1, 1999, 7:21 AM
To whoever else might be trying to accomplish this...
Finally got it working without a core dump. Your examples below were
correct, but there was some additional changes I had to make. Since I
statically compiled in the modules I had to make sure that mod_jserv
appearred *ABOVE* (<-- very important) mod_rewrite in modules.c This
wasn't the default from how Configure created modules.c Then I had to
make sure that the JServ stuff appearred before the rewrite stuff in the
configuration file.
I'm still of the opinion that mod_rewrite is voodoo magic... I've got to
get a book on regular expression and really learn them. That one class
back in college just doesn't make ya an expert!
Jonathan Tew |