httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [users@httpd] mod_rewrite's behaviour changes while upgrading Apache1 -> 2
Date Fri, 03 Sep 2004 07:32:30 GMT

I would like to upgrade Apache1 (13.29)  to Apache2 (2.0.50) but an exact behaviour of mod_rewrite
have changed.

We're rewriting URL (hiding php page and variables)

How this zone is defined first:

        ServerAlias *
        RewriteEngine On
        RewriteCond  %{HTTP_HOST} !^www
        RewriteCond  %{HTTP_HOST} ^([^.]+)
        RewriteCond  %{DOCUMENT_ROOT}/%1 -d
        RewriteRule  ^/(.*) %{DOCUMENT_ROOT}/%1/$1
        RewriteCond  %{HTTP_HOST}  ^www\.ceadvisor\.cz
        RewriteRule  ^/page_(.*)_(.*)\.html$$1&service=$2
        DocumentRoot /domains/
        ErrorLog logs/
        TransferLog logs/
        ErrorDocument   404     /404.php

First set of Conds and the first rule should point subdomain into folders (easy and working)
The last Cond & Rule is the rule to hide php pages with 2 variables into a fake html page
(to get better crawler positioning etc.)

Behaviour of Apache1:
Everything is fine and working, when I run  ->
the correct index.php?page=zviditelneni&service=1  is called and there's
in the URL line of my browser. That's how it should work

Behaviour of Apache2:
Unfortunately apache2 is doing it wrong. It calls good page, BUT send 302 REDIRECT code and
redirect user to that php page. So, the problem is that user see index.php?page=zviditelneni&service=1
in his URL row instead of

Check log for details :-/ - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(2) init rewrite eng
ine with requested uri /page_zviditelneni_1.html - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(3) applying pattern
 '^/(.*)' to uri '/page_zviditelneni_1.html' - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(4) RewriteCond: inp
ut='' pattern='!^www' => not-matched - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(3) applying pattern
 '^/page_(.*)_(.*)\.html$' to uri '/page_zviditelneni_1.html' - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(4) RewriteCond: inp
ut='' pattern='^www\.ceadvisor\.cz' => matched - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(2) rewrite /page_zv
iditelneni_1.html -> - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(3) split uri=http:/
/ -> uri=,
i&sluzba=1 - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(2) implicitly forci
ng redirect (rc=302) with - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(1) escaping http:// for redirect - - [29/Aug/2004:22:39:28 +0200] [][rid#84758c8/initial]
(1) redirect to http
:// [REDIRECT/302]

Could anybody help please?

Best regards,


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message