Please add ServletPath to <condition>

9 views
Skip to first unread message

Hendy Irawan

unread,
Nov 28, 2009, 6:22:52 AM11/28/09
to UrlRewrite
Hi!

Thank you for developing UrlRewrite.

I'm having a hard time creating exclude conditions for a rule. Please
add getServletPath() as one of the condition types.

Also, is it possible to check for existence of file in the requested
URI ? i.e. like mod_rewrite's -f , -e, -d, etc ?

Thanks.
Hendy

Avlesh Singh

unread,
Nov 28, 2009, 11:37:44 PM11/28/09
to urlre...@googlegroups.com
I'm having a hard time creating exclude conditions for a rule. Please add getServletPath() as one of the condition types.
Servlet path can be added but I am not too sure how much of help it would be for struts-like MVC implementations which are based on front controller design pattern; getServletPath in such cases would always return a single value.
If you have a specific scenario, you might want to post the problem here. Maybe there is an alternative solution.

Also, is it possible to check for existence of file in the requested URI ? i.e. like mod_rewrite's -f , -e, -d, etc ?
There's already a ticket to support -f, -d flags in mod_rewrite. The issue is here - http://code.google.com/p/urlrewritefilter/issues/detail?id=49. Interested in writing a patch?

Cheers
Avlesh


--

You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlre...@googlegroups.com.
To unsubscribe from this group, send email to urlrewrite+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en.



Hendy Irawan

unread,
Dec 7, 2009, 5:36:15 AM12/7/09
to UrlRewrite
On Nov 29, 11:37 am, Avlesh Singh <avl...@gmail.com> wrote:
> > I'm having a hard time creating exclude conditions for a rule. Please add
> > getServletPath() as one of the condition types.
>
> Servlet path can be added but I am not too sure how much of help it would be
> for struts-like MVC implementations which are based on front controller
> design pattern; getServletPath in such cases would always return a single
> value.
> If you have a specific scenario, you might want to post the problem here.
> Maybe there is an alternative solution.

A request of http://localhost:8080/context/path/something.html

I want to check if "/path/something.html" is equal to a list of known
paths, if so, it's excluded (so it's a negative condition).
Otherwise resume with the rewrite. Actually my wildcard would be "/
path**" but a negative one (because it's exclusion, not inclusion).

How do I get this "/path/something.html" ?

> Also, is it possible to check for existence of file in the requested URI ?> i.e. like mod_rewrite's -f , -e, -d, etc ?
>
> There's already a ticket to support -f, -d flags in mod_rewrite. The issue
> is here -http://code.google.com/p/urlrewritefilter/issues/detail?id=49.
> Interested in writing a patch?

Thanks Avlesh for the encouragement. :-)

Hendy

Avlesh Singh

unread,
Dec 7, 2009, 5:53:15 AM12/7/09
to urlre...@googlegroups.com
A request of http://localhost:8080/context/path/something.html

I want to check if "/path/something.html" is equal to a list of known
paths, if so, it's excluded (so it's a negative condition).
Otherwise resume with the rewrite. Actually my wildcard would be "/
path**" but a negative one (because it's exclusion, not inclusion).

Why not use the "request-uri" based conditions. For exclusions you can use operator="notequal". Moreover, multiple conditions can be OR'ed or AND'ed with each other. Default is "AND", you can set next="or" for each <condition> in your case.

Cheers
Avlesh

Reply all
Reply to author
Forward
0 new messages