-
1. How to rewrite the application context path?
jfclere Jan 20, 2011 3:37 AM (in response to babazs)Well the rewrite valve should be able to do that, what did you try?
-
2. How to rewrite the application context path?
babazs Jan 20, 2011 5:06 AM (in response to jfclere)Hy!
We tried to use these rules with JBossWEB:
RewriteRule ^/contextpath(.*) /contextpath$1 [L,QSA]
RewriteRule ^(.*) /contextpath$1 [L,QSA]
Could you suggest other rules for the correct rewriting, please?
Thank you so much!
-
3. How to rewrite the application context path?
jfclere Jan 21, 2011 3:23 AM (in response to babazs)Won't:
RewriteRule ^(.*) /contextpath$1 [L]
be enough?
-
4. Re: How to rewrite the application context path?
babazs Jan 21, 2011 3:44 AM (in response to jfclere)Hi!
First, thanks for your reply!
Without the first rule the html links on the generated html that contains the contextpath become /contextpath/contextpath/index.seam
So a menu link to the home page http://localhost:80/contextpath/index.seam will be converted to http://localhost:80/contextpath/contextpath/index.seam
QSA is necessary to attach the query parameters to the rewrited urls. ( http://localhost:80/contextpath/index.seam?cid=77&userId=12121 )
-
5. Re: How to rewrite the application context path?
jfclere Jan 24, 2011 2:41 AM (in response to babazs)Ok I was a bit to fast in my first answer, sorry.
So what is wrong with the 2 rules?
-
6. Re: How to rewrite the application context path?
babazs Jan 24, 2011 5:14 AM (in response to jfclere)Hi!
The menu links (and other generated links) rendered like: http://localhost:80/contextpath/index.seam in the html source, and will be converted to http://localhost:80/contextpath/index.seam , because the first rewrite rule. These urls are remained the same, but I'd like to these urls appear without the contextpath (http://localhost:80/index.seam ) . So the rewrite rule does not remove the context path in these cases.
I am searching a way to solve this problem.
-
7. Re: How to rewrite the application context path?
jfclere Jan 25, 2011 2:40 AM (in response to babazs)hm not sure what you mean...
Guessing: Some links are now http://localhost:80/contextpath/contextpath instead http://localhost:80/contextpath?