#576 Last redirect blocks preceding redirects

future
open
nobody
None
5
2014-07-16
2014-07-14
lvm_
No

If URL matches the pattern of more than one redirect action only the last one is ever tried, others are ignored i.e. if the following actions are defined in this particular order:

{+redirect{s!something!something-else}}
.example.com

{+redirect{s!anything!anything-at-all}}
.example.com

and we are opening example.com/something it is not redirected and all we get in the log is

Redirect: pcrs command "s!anything!anything-at-all" didn't change http://example.com/something

The only way I found to make the first action work is to remove the second one.

Discussion

  • Fabian Keil
    Fabian Keil
    2014-07-14

    Your examples consistently lack trailing exclamation marks,
    possibly SF's broken bug tracker ate them.

    Anyway, +redirect{} is a "parameterized action" and thus
    expected and documented to behave like this:
    | Note that if the URL matches multiple positive forms of a
    | parameterized action, the last match wins, i.e. the params
    | from earlier matches are simply ignored.
    http://www.privoxy.org/user-manual/actions-file.html#ACTIONS

    This is probably mainly for historical reasons, once upon a
    time the action didn't support pcrs commands and thus allowing
    to apply it more than once didn't make sense.

    Are you positive you need more than one pcrs command?
    It's not clear from your example problem which can be
    solved by using a path pattern. As a bonus Privoxy
    would only execute the pcrs command when a redirect
    is wanted.

     
  • lvm_
    lvm_
    2014-07-16

    Post awaiting moderation.