I would like to type
http://localhost:8840/app/about
(note than "about" does not exist neither as a directory or file.)
and then being redirected to
http://localhost:8840/app/index.jsp?pageName=about
Can anyone tell me the rule, if exist, for that?
thanks
Assuming /app is your context path:
<rule>
<from>^/about$</from>
<to type="redirect">/index.php?pageName=about</to>
</rule>
If you want something more general, you'd have to describe what the part
after /about can have in it other than "about".
Note, for this to work, you have to set up the filter mapping to cover
/about. If you're mapping UrlRewriteFilter to "/*", it should work.
-md
from that URL http://localhost:8840/ccp/cms/html/about I want
theurlrewrite to redirect to http://localhost:8840/ccp/cms/html/index.jsp
my web.xml filter mapping bit is:
<filter-mapping>
<filter-name>FriendlyURLServlet</filter-name>
<url-pattern>/ccp/cms</url-pattern>
</filter-mapping>
where /ccp/cms is my context path
and my rule:
<rule>
<from>^/about$</from>
<to>%{context-path}/html/index.jsp</to>
</rule>
any idea of what is wrong?
I'm not sure why you've gotten a 403, but I don't think that
UrlRewriteFilter is being hit.
> from that URL http://localhost:8840/ccp/cms/html/about I want
> theurlrewrite to redirect to http://localhost:8840/ccp/cms/html/index.jsp
>
> my web.xml filter mapping bit is:
>
> <filter-mapping>
> <filter-name>FriendlyURLServlet</filter-name>
> <url-pattern>/ccp/cms</url-pattern>
> </filter-mapping>
>
> where /ccp/cms is my context path
>
> and my rule:
> <rule>
> <from>^/about$</from>
> <to>%{context-path}/html/index.jsp</to>
> </rule>
>
> any idea of what is wrong?
If your context path is really "/ccp/cms", then need something like this
in web XML:
<filter-mapping>
<filter-name>FriendlyURLServlet</filter-name>
<url-pattern>/html/*</url-pattern>
</filter-mapping>
And this in urlrewrite.xml:
<rule>
<from>^/html/about$</from>
<to type="redirect">/html/index.jsp?pageName=about</to>
</rule>
Nothing in web.xml or urlrewrite.xml generally needs to know what your
context path is since they default to doing everything relative to the
context path.
Note: if you really want to "redirect" (in which case the user will see
"index.jsp" in their browser), you need type="redirect". Otherwise, what
you're doing is called "forwarding" and you probably need last="true" on
the <to> element. If you want names other than "about" to work, you'll
have to tell us what those possible names look like so that the <from>
pattern can be changed to accomodate other names.
-md
thank you very mutch for your help.
On 8 Nov, 16:14, Mike Dillon <m...@embody.org> wrote:
> begin Xavi quotation:
>
> > hmm. I've got a Forbidden (403)You have requested data that the server
> > has decided not to provide to you. Your request was understood and
> > denied.
>
> I'm not sure why you've gotten a 403, but I don't think that
> UrlRewriteFilter is being hit.
>
>
>
> > from that URLhttp://localhost:8840/ccp/cms/html/aboutI want
> > theurlrewrite to redirect tohttp://localhost:8840/ccp/cms/html/index.jsp