In httpd.conf, are you doing a redirect [R] or a passthrough [PT] ?
Assuming you're not explicitly redirecting the request, you should probably
check your modifications to whichever tomcat module you're using in Apache.
The thing to look, I think, is which URI is being set into the request
structure. The mod_webapp module does this early on in wam_match() before
mod_rewrite has a chance to do its work:
ap_set_module_config(r->request_config, &webapp_module, appl);
I essentially moved this bit to wam_invoke() which happens last when the
request is actually serviced.
I'm not one of the developers on this project, so I'm guessing here and
there. It would probably be worth running your modifications by the
tomcat-dev mailing list or Pier Fumagalli ([EMAIL PROTECTED]) who's name
is on the webapp.c module, if they have time to listen. My impression is
that this group of developers decided to explicitly over-ride mod_rewrite
because they thought this would result in a truer implementation of Sun's
servlet API.
Dan
At 04:21 PM 3/15/02 +0000, James Williamson wrote:
>Thanks Dan,
>
>Actually I did something pretty similar (changing OK to DECLINED in
>wam_match), knowing that after a handler in the url rewrite stage has
>returned OK no other (such as mod_rewrite) gets a look in. However, this
>still didn't work for me, even though mod_rewrite in the logs said it'd
>rewritten / as /index.jsp, I still got the 302?
>
>James
>
>----- Original Message -----
>From: Dan Lindy <[EMAIL PROTECTED]>
>To: James Williamson <[EMAIL PROTECTED]>; Edam Cheeseman
><[EMAIL PROTECTED]>
>Cc: Tomcat Users List <[EMAIL PROTECTED]>
>Sent: Friday, March 15, 2002 4:20 PM
>Subject: Re: OFFTOPIC: apache mod_rewrite
>
>
> > James et al.,
> >
> > I use hacked version of mod_webapp.c on Apache 1.3 to do exactly this.
> > My modifications may be crude, but it's worked well for me so far:
> >
> > /* Match an Apache request */
> > static int wam_match(request_rec *r) {
> > wa_virtualhost *host=NULL;
> > // wa_application *appl=NULL;
> > // wa_chain *elem=NULL;
> >
> > /* Paranoid check */
> > if (!wam_initialized) return(DECLINED);
> >
> > /* Check if this host was recognized */
> >
>host=ap_get_module_config(r->server->module_config,&webapp_module);
> > if (host==NULL) return(DECLINED);
> >
> > // /* Check if the uri is contained in one of our applications
> > root path */
> > // elem=host->apps;
> > // while(elem!=NULL) {
> > // appl=(wa_application *)elem->curr;
> > // if (strncmp(appl->rpth,r->uri,strlen(appl->rpth))==0)
>break;
> > //
> > // appl=NULL;
> > // elem=elem->next;
> > // }
> > // if (appl==NULL) return(DECLINED);
> >
> > /* The uri path is matched: set the handler and return */
> > r->handler=ap_pstrdup(r->pool,"webapp-handler");
> >
> > // /* Set the webapp request structure into Apache's request
> > structure */
> > // ap_set_module_config(r->request_config, &webapp_module,
>appl);
> > // return(OK);
> > return(DECLINED); // added
> >
> > }
> >
> > /* Handle the current request */
> > static int wam_invoke(request_rec *r) {
> > server_rec *svr=r->server;
> > conn_rec *con=r->connection;
> > wa_virtualhost *host=NULL; // added
> > wa_application *appl=NULL;
> > wa_chain *elem=NULL; // added
> > wa_request *req=NULL;
> > const char *msg=NULL;
> > char *stmp=NULL;
> > char *ctmp=NULL;
> > char *ssl_temp;
> > int ret=0;
> >
> > /* Paranoid check */
> > if (!wam_initialized) return(DECLINED);
> >
> > // begin added...
> >
> > /* Check if this host was recognized */
> >
>host=ap_get_module_config(r->server->module_config,&webapp_module);
> > if (host==NULL) return(DECLINED);
> >
> > /* Check if the uri is contained in one of our applications
> > root path */
> > elem=host->apps;
> > while(elem!=NULL) {
> > appl=(wa_application *)elem->curr;
> > if (strncmp(appl->rpth,r->uri,strlen(appl->rpth))==0)
>break;
> >
> > appl=NULL;
> > elem=elem->next;
> > }
> > if (appl==NULL) return(DECLINED);
> >
> > /* Set the webapp request structure into Apache's request
> > structure */
> > ap_set_module_config(r->request_config, &webapp_module,
>appl);
> >
> > // ...end added
> >
> > Regards,
> > Dan Lindy
> >
> > At 04:02 PM 3/15/02 +0000, you wrote:
> > >Hi Paul,
> > >
> > >I sent a message to the dev list about this (no response, I even offered
>to
> > >do the
> > >coding). I've tried mod_rewrite to probably do exactly what you've been
> > >doing (no luck).
> > > I don't think it is off topic, because search engines will leave
> > >immediately when they
> > >see the 302 response which will dramatically affect your site's traffic.
> > >
> > >Regards,
> > >
> > >James Williamson
> > >
> > >www.nameonthe.net
> > >
> > >
> > >----- Original Message -----
> > >From: Edam Cheeseman <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Sent: Friday, March 15, 2002 2:57 PM
> > >Subject: OFFTOPIC: apache mod_rewrite
> > >
> > >
> > > > Hi list,
> > > >
> > > > Just wondering if anyone has tried using apache mod_rewrite to rewrite
> > >their
> > > > URLs allow search engines to crawl their dynamic tomcat-served pages?
> > > >
> > > > If so, have you noticed any favourable impact on your rankings? Just
> > >curious
> > > > to see if its worth doing before I invest what looks like a lot of
>time
> > > > figuring out how to do it.
> > > >
> > > > thanks,
> > > >
> > > > Paul
> > > >
> > > > _________________________________________________________________
> > > > Get your FREE download of MSN Explorer at
> > >http://explorer.msn.com/intl.asp.
> > > >
> > > >
> > > > --
> > > > To unsubscribe: <mailto:[EMAIL PROTECTED]>
> > > > For additional commands: <mailto:[EMAIL PROTECTED]>
> > > > Troubles with the list: <mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > >
> > >--
> > >To unsubscribe: <mailto:[EMAIL PROTECTED]>
> > >For additional commands: <mailto:[EMAIL PROTECTED]>
> > >Troubles with the list: <mailto:[EMAIL PROTECTED]>
> >
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>