RewritingURL with Tomcat3.2.1

2001-05-21 Thread Lessault Jean-Luc


Hi all,
I am using Tomcat 3.2.1 with Apache 1.3
and I have the following problem:


  I want to rewrite a path from a form like  'http://host:port/file.html'   
  to something like
'http://host:port/ContextServlet/MyServletName?parameter=file.html').
  (Note that  the program works when i use the  second URL form in the
browser).
  So that, as it seems that Tomcat doesn't want to use .htaccess file, I
decided 
  to write the following instructions:
 
LoadModule rewrite_module module/mod_rewrite.dll
IfModule mod_rewrite.c
 RewriteEngine On
 RewriteBase /ContextServlet/
 RewriteRule ^file.html
/ContextServlet/MyServletName?parameter=file.html.
/IfModule

   in tomcat.conf or server.xml but with no result.  
   
 Any help will be greatly appreciate.





Re: RewritingURL with Tomcat3.2.1

2001-05-21 Thread sfarrell


L,

You need to add the [PT] parameter to your rewrite rule - it worked for
me!!


regards
Scott Farrell

http://www.icconsulting.com.au
ic Consulting - integrating your business in a web world.
We offer e-business consulting and perform services. We deliver high impact
consulting, and fast turn around projects for our clients.
Ask us about Web Content Management,  Web Self Service, or working closer
with your customers or suppliers.

0412 927 156,   02 9411 3622  mailto:[EMAIL PROTECTED]



   
  
Lessault   
  
Jean-Luc  To: '[EMAIL PROTECTED]' 
[EMAIL PROTECTED]
JL.Lessault@kcc:  
  
heops.comSubject: RewritingURL with Tomcat3.2.1   
  
   
  
21/05/2001 
  
06:33 PM   
  
Please respond 
  
to tomcat-user 
  
   
  
   
  





Hi all,
I am using Tomcat 3.2.1 with Apache 1.3
and I have the following problem:


  I want to rewrite a path from a form like  'http://host:port/file.html'

  to something like
'http://host:port/ContextServlet/MyServletName?parameter=file.html').
  (Note that  the program works when i use the  second URL form in the
browser).
  So that, as it seems that Tomcat doesn't want to use .htaccess file, I
decided
  to write the following instructions:

LoadModule rewrite_module module/mod_rewrite.dll
IfModule mod_rewrite.c
 RewriteEngine On
 RewriteBase /ContextServlet/
 RewriteRule ^file.html
/ContextServlet/MyServletName?parameter=file.html.
/IfModule

   in tomcat.conf or server.xml but with no result.

 Any help will be greatly appreciate.









Re: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Valeriy Molyakov

Hi !
Your should use servlet mapping.
For example:

servlet
servlet-name
MyServletName
/servlet-name
servlet-class
MyServletNameClass
/servlet-class
/servlet
servlet-mapping
servlet-name
MyServletName
/servlet-name
url-pattern
/file.html
/url-pattern
/servlet-mapping

Best regards !
- Original Message -
From: Lessault Jean-Luc [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 21, 2001 11:33 AM
Subject: RewritingURL with Tomcat3.2.1



 Hi all,
 I am using Tomcat 3.2.1 with Apache 1.3
 and I have the following problem:


   I want to rewrite a path from a form like  'http://host:port/file.html'
   to something like
 'http://host:port/ContextServlet/MyServletName?parameter=file.html').
   (Note that  the program works when i use the  second URL form in the
 browser).
   So that, as it seems that Tomcat doesn't want to use .htaccess file, I
 decided
   to write the following instructions:

 LoadModule rewrite_module module/mod_rewrite.dll
 IfModule mod_rewrite.c
  RewriteEngine On
  RewriteBase /ContextServlet/
  RewriteRule ^file.html
 /ContextServlet/MyServletName?parameter=file.html.
 /IfModule

in tomcat.conf or server.xml but with no result.

  Any help will be greatly appreciate.





RE: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Lessault Jean-Luc


Thanks but I already use servlet mapping.
More preciasely my question is in which file I have to put the following
instructions

  LoadModule rewrite_module module/mod_rewrite.dll
 IfModule mod_rewrite.c
  RewriteEngine On
  RewriteBase /ContextServlet/
  RewriteRule ^file.html
 /ContextServlet/MyServletName?parameter=file.html.
 /IfModule

Have a good day




RE: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Rob Ewaschuk


There is fairly good documentation of the mod_rewrite on the apache httpd
website at http://httpd.apache.org/docs/misc/rewrite

I believe you will need to have ^/file.html and not just ^file.html - the
paths that are parsed include (I think) the leading slash. 

hth...

-Rob

: Rob Ewaschuk :  University of Waterloo  :
:  theideaproject.org  : Computer Science :

On Mon, 21 May 2001, Lessault Jean-Luc wrote:

 
 Thanks but I already use servlet mapping.
 More preciasely my question is in which file I have to put the following
 instructions
 
   LoadModule rewrite_module module/mod_rewrite.dll
  IfModule mod_rewrite.c
   RewriteEngine On
   RewriteBase /ContextServlet/
   RewriteRule ^file.html
  /ContextServlet/MyServletName?parameter=file.html.
  /IfModule
 
 Have a good day
 




Re: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Tim O'Neil

Anyone have any problems with Apache's mod re-write
and tomcat and ssl? Our web server seems to be completely
ignoring the mod re-write rules when in ssl mode...




Re: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Jan Labanowski



On Mon, 21 May 2001, Tim O'Neil wrote:

 Anyone have any problems with Apache's mod re-write
 and tomcat and ssl? Our web server seems to be completely
 ignoring the mod re-write rules when in ssl mode...
 

Make sure that your rewrite rules are within the SSL virtual server block.
VirtualHost _default_:443
..
IfModule mod_rewrite.c
 RewriteEngine On
 RewriteLog /usr/local/apache_1.3.14/logs/rewrite_log
 RewriteLogLevel 1
 RewriteRule ^/ROOT/examples /examples [R]
   
/IfModule

/VirtualHost

Make sure that your  modules are in the following order in httpd.conf

LoadModule jk_module  libexec/mod_jk.so
 
LoadModule rewrite_module libexec/mod_rewrite.so
 
LoadModule ssl_module libexec/libssl.so
 
AddModule mod_jk.c
 
AddModule mod_rewrite.c
 
AddModule mod_ssl.c

Make sure that you do not have the AddModule mod_jk.c and LoadModule jk_module
in the mod_jk.conf file which you include at the end





Jan K. Labanowski|phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center|Internet: [EMAIL PROTECTED] 
1224 Kinnear Rd, |http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163  |http://www.osc.edu/




Re: RewritingURL with Tomcat3.2.1

2001-05-21 Thread Tim O'Neil

At 10:30 AM 5/21/2001 -0700, you wrote:
Anyone have any problems with Apache's mod re-write
and tomcat and ssl? Our web server seems to be completely
ignoring the mod re-write rules when in ssl mode...

Ah... you have to put the url rewrite in the virtual
server definition for ssl... nice.