Static 4 Apache, Dynamic 4 Tomcat / mod_rewrite ?!? / POST form
--- THE INTRODUCTION --
Hem first : +1 ;)
--- THE ADVENTURE CONTINUES ---
Well, It's finally working
Yes my appli on linux + tomcat + mod_jk !!!
The problem... well hemm...
In fact I'm working under NT and testing under linux,
and the fact is that my web-inf under NT was web-inf under Linux
... not WEB-INF how frustrating isn't it.
--- THE PROBLEM ---
So now It's working but I've got one problem:
I use the mod_rewrite module to protect some directories, to
let apache manage static files and...to rewrite somr url...
(I access to my servlet via http://lol.fivia.com/lol/AdFront)
--- PART OF MOD_JK.CONF ---
Here they are (explained too):
-1- RedirectMatch /index.html $1/start/index.html
-2- RewriteEngine on
-3- RewriteLog /usr/local/tomcat/log/lol_rewrite.log
-4- RewriteLogLevel 9
-5- RewriteCond %{REQUEST_URI} ^/servlet* [NC]
-6- RewriteRule ^/servlet/(.*) /lol/$1 [PT]
-7- RewriteCond %{REQUEST_URI} !^/lol* [NC]
-8- RewriteCond %{REQUEST_URI} !^/Image* [NC]
-9- RewriteCond %{REQUEST_URI} !^/Elemtech* [NC]
-10- RewriteCond %{REQUEST_URI} !^/Erreur* [NC]
-11- RewriteCond %{REQUEST_URI} ^/.*/.*
-12- RewriteRule ^/(.*) /lol/AdFront?access=/$1 [PT,QSA]
--- THE EXPLANATIONS ---
-1- So when you enter http://lol.fivia.com/ + [Enter] the url
becomes http://lol.fivia.com/index.html (default page)
then http://lol.fivia.com/start/index.html
-2- mod_rewrite enabled
-3- logfile for mod_rewrite
-4- log level : to the maximum
-5- First condition of the first rule (conditions come before rules)
flag : NC = no case
-6- First rule: if my url begins with /servlet/ + 0 or any characters and
the 1st condition is true () the url becomes /lol/ + 0 or any
characters.
then because of the flag PT (Pass Through), the result of the rewrite
rule
go to the next rule...
-7- 1st condition of 2nd rule (no case)
-8- 1st condition of 2nd rule (no case)
-9- 1st condition of 2nd rule (no case)
-10- 1st condition of 2nd rule (no case)
-11- 1st condition of 2nd rule
-12- 2nd rule: if my url begins with a / + 0 or any characters (path
through + query string append)
and (1st condition) it does NOT begin with /lol
and (2nd condition) it does NOT begin with /Image
and (3rd condition) it does NOT begin with /Elemtech
and (4th condition) it does NOT begin with /Erreur
and (5th condition) it is NOT build with 2 '/' then
the url becomes /lol/AdFront?access=/ + url of the begining
example: http://lol.fivia.com/start/index.html becomes
http://lol.fivia.com/lol/AdFront?access=/start/index.html
--- THE RESULTS ---
So it does NOT work :-( (it works with JServ). I've read some faqs and as it
says,
I tried to whange [PT] to [R] (redirect) and it works!!!
BUT NOT when I submit a post form!!!
--- THE QUESTIONS ---
So here are my questions:
-1- Is there any bug whith POST forms?
-2- Can these rules be changed with servlet-aliasing and how?
-3- Should I program my own Invoker and if yes, which one would I replace?
-4- Can you give me your comments?
--- THE SIGNATURE ---
Loïc Lefèvre
--- THE BOTTOM OF THE WINDOW ---