httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Fantuzzi <>
Subject [users@httpd] Url rewrite and Tomcat
Date Thu, 11 Sep 2008 20:14:44 GMT
I work for a web factory.
We have many sites made with jsp pages, so we have Apache and Tomcat 
working together.
For these sites we put rules like this in httpd.conf:
/folder/my_page.jsp?sez=$2&pag=$4 [R,L]
This rule works fine but a SEO Agency told us that it is better not to 
do the redirect and mantain the friendly url.
At first it seemed simple, in fact all you have to do is remove the "R" 
option from the rule.
But if we do so we get an error.
If you are calling
you get this error:

  HTTP Status 404 - /folder/1_language/90_Products/126_Product.html


*type* Status report

*message* _/folder/1_language/90_Products/126_Product.html_

*description* _The requested resource 
(/folder/1_language/90_Products/126_Product.html) is not available._


      Apache Tomcat/5.5.25

As you can see it seems like Apache passes the command to Tomcat but 
instead of telling it to use /folder/my_page.jsp?sez=90&pag=126 it 
passes /folder/1_language/90_Products/126_Product.html
which Tomcat cannot find.

This is the VirtualHost definition:

<VirtualHost *:80>
DocumentRoot     "C:/Programmi/Apache Software Foundation/Tomcat 

JkMount     /main_folder/*.jsp worker1
JkMount     /* worker1

RewriteEngine on

/folder/my_page.jsp?sez=$2&pag=$4 [L]

RewriteLog logs/rewrite.log
RewriteLogLevel 9

ErrorLog logs/site_error_log
CustomLog logs/site_access_log common

And this is the rewrite log file:
(2) init rewrite engine with requested uri 
(3) applying pattern 
^/folder/([^/]+)_language/([^/]+)_([^/]+)/([^/]+)_([^/]+)\.html to uri 
(2) rewrite /folder/1_language/90_Products/126_Product.html -> 
(3) split uri=/folder/my_page.jsp?sez=90&pag=126 -> 
uri=/folder/my_page.jsp, args=sez=90&pag=126
(2) local path result: /folder/my_page.jsp
(2) prefixed with document_root to C:/Programmi/Apache Software 
Foundation/Tomcat 5.5/webapps/main_folder/folder/my_page.jsp
(1) go-ahead with C:/Programmi/Apache Software Foundation/Tomcat 
5.5/webapps/helvetia/public/helvetia.jsp [OK]

Any help appreciated.



Alessandro Fantuzzi - O-one s.r.l.
E-mail: <>
Software developer <>

Via Dante Zanichelli, 61 - 42100 Reggio Emilia
Tel. 0522 930078 - Fax. 0522 387947
Via Stendhal, 36 - 20144 Milano
Tel 02.42292057 - Fax 02.47770936

STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential 
and proprietary material for the sole use of the intended recipient. Any 
review or distribution by others is strictly prohibited. If you are not 
the intended recipient please contact the sender and delete all copies. 
The contents of this message that do not relate to the official business 
of our company shall be understood as neither given nor endorsed by it.

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