You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Pe...@gmx.net on 2005/11/14 10:12:53 UTC

[users@httpd] Problem mit httpd2 + tomcat5.5.9 + mod_rewrite

Hello,

I'm still struggling with the mod_rewrite module in combination with the
tomcat server. 

I changed my configuration to this:

LoadModule rewrite_module /usr/lib/apache2/mod_rewrite.so
RewriteEngine on
RewriteLog /var/log/apache2/mod_rewrite.log
RewriteLogLevel 2
RewriteRule ^/pnbw/postHv\.html$ /nothing.htm

But it still does not work. The log output tells me this:

[rid#8182058/initial] (2) init rewrite engine with requested uri
/pnbw/postHv.html
[rid#8182058/initial] (2) rewrite /pnbw/postHv.html -> /nothing.htm
[rid#8182058/initial] (2) local path result: /nothing.htm
[rid#8182058/initial] (2) prefixed with document_root to /nothing.htm
[rid#8182058/initial] (1) go-ahead with /nothing.htm [OK]

This looks like it works. But in the browser window I still see the url I
wanted to have replaced. 

Does anybody have an idea what could be wrong? 

cheers,
Pete

-- 
Highspeed-Freiheit. Bei GMX superg�nstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate f�r nur 4,99 Euro/Monat*  http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem mit httpd2 + tomcat5.5.9 + mod_rewrite

Posted by Joshua Slive <js...@gmail.com>.
On 11/14/05, Peter.Neu@gmx.net <Pe...@gmx.net> wrote:
> Hi Joshua,
>
> I put the [R] behind the rule and get a HTTP 400 Error. It says it can't
> find the server. The RewriteLog says that I tried to force a redirect to a
> URL which does not exist. That's right because the URL I gernerate with
> mod_rewrite is fake.

It sounds like your RewriteRule might be backwards.  How about
describing exactly what you want to happen (ie exactly what the user
should type in the browser, and exactly what she should see).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem mit httpd2 + tomcat5.5.9 + mod_rewrite

Posted by Pe...@gmx.net.
Hi Joshua,

I put the [R] behind the rule and get a HTTP 400 Error. It says it can't
find the server. The RewriteLog says that I tried to force a redirect to a
URL which does not exist. That's right because the URL I gernerate with
mod_rewrite is fake. 


cheers,
Pete


> --- Ursprüngliche Nachricht ---
> Von: Joshua Slive <js...@gmail.com>
> An: users@httpd.apache.org
> Betreff: Re: [users@httpd] Problem mit httpd2 + tomcat5.5.9 + mod_rewrite
> Datum: Mon, 14 Nov 2005 09:28:48 -0500
> 
> On 11/14/05, Peter.Neu@gmx.net <Pe...@gmx.net> wrote:
> > Hello,
> >
> > I'm still struggling with the mod_rewrite module in combination with the
> > tomcat server.
> >
> > I changed my configuration to this:
> >
> > LoadModule rewrite_module /usr/lib/apache2/mod_rewrite.so
> > RewriteEngine on
> > RewriteLog /var/log/apache2/mod_rewrite.log
> > RewriteLogLevel 2
> > RewriteRule ^/pnbw/postHv\.html$ /nothing.htm
> >
> > But it still does not work. The log output tells me this:
> >
> > [rid#8182058/initial] (2) init rewrite engine with requested uri
> > /pnbw/postHv.html
> > [rid#8182058/initial] (2) rewrite /pnbw/postHv.html -> /nothing.htm
> > [rid#8182058/initial] (2) local path result: /nothing.htm
> > [rid#8182058/initial] (2) prefixed with document_root to /nothing.htm
> > [rid#8182058/initial] (1) go-ahead with /nothing.htm [OK]
> >
> > This looks like it works. But in the browser window I still see the url
> I
> > wanted to have replaced.
> >
> > Does anybody have an idea what could be wrong?
> 
> If you want "/nothing.htm" to appear in the browser's location bar,
> then add [R] to the end of the RerwriteRule.
> 
> Joshua.
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

-- 
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem mit httpd2 + tomcat5.5.9 + mod_rewrite

Posted by Joshua Slive <js...@gmail.com>.
On 11/14/05, Peter.Neu@gmx.net <Pe...@gmx.net> wrote:
> Hello,
>
> I'm still struggling with the mod_rewrite module in combination with the
> tomcat server.
>
> I changed my configuration to this:
>
> LoadModule rewrite_module /usr/lib/apache2/mod_rewrite.so
> RewriteEngine on
> RewriteLog /var/log/apache2/mod_rewrite.log
> RewriteLogLevel 2
> RewriteRule ^/pnbw/postHv\.html$ /nothing.htm
>
> But it still does not work. The log output tells me this:
>
> [rid#8182058/initial] (2) init rewrite engine with requested uri
> /pnbw/postHv.html
> [rid#8182058/initial] (2) rewrite /pnbw/postHv.html -> /nothing.htm
> [rid#8182058/initial] (2) local path result: /nothing.htm
> [rid#8182058/initial] (2) prefixed with document_root to /nothing.htm
> [rid#8182058/initial] (1) go-ahead with /nothing.htm [OK]
>
> This looks like it works. But in the browser window I still see the url I
> wanted to have replaced.
>
> Does anybody have an idea what could be wrong?

If you want "/nothing.htm" to appear in the browser's location bar,
then add [R] to the end of the RerwriteRule.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org