<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<link rel="PREVIOUS" title="See Also" href="seealso.html">
<link rel="STYLESHEET" type="text/css" href="../p_doc.css">
<link rel="PREVIOUS" title="See Also" href="seealso.html">
<link rel="STYLESHEET" type="text/css" href="../p_doc.css">
<body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
"#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
"#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<p><span class="APPLICATION">Privoxy</span> uses Perl-style
<span class="QUOTE">"regular expressions"</span> in its <a href=
"actions-file.html">actions files</a> and <a href=
"filter-file.html">filter file</a>, through the <a href=
"http://www.pcre.org/" target="_top">PCRE</a> and <span class=
"APPLICATION">PCRS</span> libraries.</p>
<p><span class="APPLICATION">Privoxy</span> uses Perl-style
<span class="QUOTE">"regular expressions"</span> in its <a href=
"actions-file.html">actions files</a> and <a href=
"filter-file.html">filter file</a>, through the <a href=
"http://www.pcre.org/" target="_top">PCRE</a> and <span class=
"APPLICATION">PCRS</span> libraries.</p>
<p>If you are reading this, you probably don't understand what
<span class="QUOTE">"regular expressions"</span> are, or what they can
do. So this will be a very brief introduction only. A full explanation
would require a <a href="http://www.oreilly.com/catalog/regex/" target=
"_top">book</a> ;-)</p>
<p>If you are reading this, you probably don't understand what
<span class="QUOTE">"regular expressions"</span> are, or what they can
do. So this will be a very brief introduction only. A full explanation
would require a <a href="http://www.oreilly.com/catalog/regex/" target=
"_top">book</a> ;-)</p>
<p>Regular expressions provide a language to describe patterns that can
be run against strings of characters (letter, numbers, etc), to see if
they match the string or not. The patterns are themselves (sometimes
<p>Regular expressions provide a language to describe patterns that can
be run against strings of characters (letter, numbers, etc), to see if
they match the string or not. The patterns are themselves (sometimes
build complex patterns to be matched against. Perl Compatible Regular
Expressions are an especially convenient <span class=
"QUOTE">"dialect"</span> of the regular expression language.</p>
build complex patterns to be matched against. Perl Compatible Regular
Expressions are an especially convenient <span class=
"QUOTE">"dialect"</span> of the regular expression language.</p>
<p>To make a simple analogy, we do something similar when we use
wild-card characters when listing files with the <b class=
"COMMAND">dir</b> command in DOS. <tt class="LITERAL">*.*</tt> matches
<p>To make a simple analogy, we do something similar when we use
wild-card characters when listing files with the <b class=
"COMMAND">dir</b> command in DOS. <tt class="LITERAL">*.*</tt> matches
"QUOTE">"file2.txt"</span>, etc. We are pattern matching, using a
similar technique to <span class="QUOTE">"regular
expressions"</span>!</p>
"QUOTE">"file2.txt"</span>, etc. We are pattern matching, using a
similar technique to <span class="QUOTE">"regular
expressions"</span>!</p>
<p>Regular expressions do essentially the same thing, but are much,
much more powerful. There are many more <span class="QUOTE">"special
characters"</span> and ways of building complex patterns however. Let's
look at a few of the common ones, and then some examples:</p>
<p>Regular expressions do essentially the same thing, but are much,
much more powerful. There are many more <span class="QUOTE">"special
characters"</span> and ways of building complex patterns however. Let's
look at a few of the common ones, and then some examples:</p>
<p>These are just some of the ones you are likely to use when matching
URLs with <span class="APPLICATION">Privoxy</span>, and is a long way
from a definitive list. This is enough to get us started with a few
simple examples which may be more illuminating:</p>
<p>These are just some of the ones you are likely to use when matching
URLs with <span class="APPLICATION">Privoxy</span>, and is a long way
from a definitive list. This is enough to get us started with a few
simple examples which may be more illuminating:</p>
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/banners/.*</tt></i></span> - A simple example that uses
the common combination of <span class="QUOTE">"."</span> and
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/banners/.*</tt></i></span> - A simple example that uses
the common combination of <span class="QUOTE">"."</span> and
just <span class="QUOTE">"/banners/annoying.html"</span>, or almost an
infinite number of other possible combinations, just so it has
<span class="QUOTE">"banners"</span> in the path somewhere.</p>
just <span class="QUOTE">"/banners/annoying.html"</span>, or almost an
infinite number of other possible combinations, just so it has
<span class="QUOTE">"banners"</span> in the path somewhere.</p>
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/adv((er)?ts?|ertis(ing|ements?))?/</tt></i></span> - We
have several literal forward slashes again (<span class=
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/adv((er)?ts?|ertis(ing|ements?))?/</tt></i></span> - We
have several literal forward slashes again (<span class=
<span class="APPLICATION">adv</span>, together with the forward
slashes. What comes after the <span class="QUOTE">"adv"</span> string
is the interesting part.</p>
<span class="APPLICATION">adv</span>, together with the forward
slashes. What comes after the <span class="QUOTE">"adv"</span> string
is the interesting part.</p>
<p>Remember the <span class="QUOTE">"?"</span> means the preceding
expression (either a literal character or anything grouped with
<span class="QUOTE">"(...)"</span> in this case) can exist or not,
<p>Remember the <span class="QUOTE">"?"</span> means the preceding
expression (either a literal character or anything grouped with
<span class="QUOTE">"(...)"</span> in this case) can exist or not,
expression to: <span class=
"QUOTE">"/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/"</span>, which
would then match either spelling.</p>
expression to: <span class=
"QUOTE">"/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/"</span>, which
would then match either spelling.</p>
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/advert[0-9]+\.(gif|jpe?g)</tt></i></span> - Again another
path statement with forward slashes. Anything in the square brackets
<p><span class="emphasis"><i class="EMPHASIS"><tt class=
"LITERAL">/.*/advert[0-9]+\.(gif|jpe?g)</tt></i></span> - Again another
path statement with forward slashes. Anything in the square brackets
include an <span class="QUOTE">"s"</span>), or <span class=
"QUOTE">"/advert1.jsp"</span> (<span class="QUOTE">"jsp"</span> is not
in the expression anywhere).</p>
include an <span class="QUOTE">"s"</span>), or <span class=
"QUOTE">"/advert1.jsp"</span> (<span class="QUOTE">"jsp"</span> is not
in the expression anywhere).</p>
<p>We are barely scratching the surface of regular expressions here so
that you can understand the default <span class=
"APPLICATION">Privoxy</span> configuration files, and maybe use this
knowledge to customize your own installation. There is much, much more
that can be done with regular expressions. Now that you know enough to
get started, you can learn more on your own :/</p>
<p>We are barely scratching the surface of regular expressions here so
that you can understand the default <span class=
"APPLICATION">Privoxy</span> configuration files, and maybe use this
knowledge to customize your own installation. There is much, much more
that can be done with regular expressions. Now that you know enough to
get started, you can learn more on your own :/</p>
<p>More reading on Perl Compatible Regular expressions: <a href=
"http://perldoc.perl.org/perlre.html" target=
"_top">http://perldoc.perl.org/perlre.html</a></p>
<p>More reading on Perl Compatible Regular expressions: <a href=
"http://perldoc.perl.org/perlre.html" target=
"_top">http://perldoc.perl.org/perlre.html</a></p>
<p>For information on regular expression based substitutions and their
applications in filters, please see the <a href=
"filter-file.html">filter file tutorial</a> in this manual.</p>
</div>
<p>For information on regular expression based substitutions and their
applications in filters, please see the <a href=
"filter-file.html">filter file tutorial</a> in this manual.</p>
</div>
<p>Since <span class="APPLICATION">Privoxy</span> proxies each
requested web page, it is easy for <span class=
"APPLICATION">Privoxy</span> to trap certain special URLs. In this way,
<p>Since <span class="APPLICATION">Privoxy</span> proxies each
requested web page, it is easy for <span class=
"APPLICATION">Privoxy</span> to trap certain special URLs. In this way,
these rules and other configuration options, and even turn <span class=
"APPLICATION">Privoxy's</span> filtering off, all with a web
browser.</p>
these rules and other configuration options, and even turn <span class=
"APPLICATION">Privoxy's</span> filtering off, all with a web
browser.</p>
<p>The URLs listed below are the special ones that allow direct access
to <span class="APPLICATION">Privoxy</span>. Of course, <span class=
"APPLICATION">Privoxy</span> must be running to access these. If not,
you will get a friendly error message. Internet access is not necessary
either.</p>
<p>The URLs listed below are the special ones that allow direct access
to <span class="APPLICATION">Privoxy</span>. Of course, <span class=
"APPLICATION">Privoxy</span> must be running to access these. If not,
you will get a friendly error message. Internet access is not necessary
either.</p>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/" target=
"_top">http://config.privoxy.org/</a></p>
</blockquote>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/" target=
"_top">http://config.privoxy.org/</a></p>
</blockquote>
<p>There is a shortcut: <a href="http://p.p/" target=
"_top">http://p.p/</a> (But it doesn't provide a fall-back to a
real page, in case the request is not sent through <span class=
"APPLICATION">Privoxy</span>)</p>
</li>
<p>There is a shortcut: <a href="http://p.p/" target=
"_top">http://p.p/</a> (But it doesn't provide a fall-back to a
real page, in case the request is not sent through <span class=
"APPLICATION">Privoxy</span>)</p>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-status" target=
"_top">http://config.privoxy.org/show-status</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-status" target=
"_top">http://config.privoxy.org/show-status</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-version" target=
"_top">http://config.privoxy.org/show-version</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-version" target=
"_top">http://config.privoxy.org/show-version</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-request" target=
"_top">http://config.privoxy.org/show-request</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-request" target=
"_top">http://config.privoxy.org/show-request</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-url-info" target=
"_top">http://config.privoxy.org/show-url-info</a></p>
</blockquote>
</li>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/show-url-info" target=
"_top">http://config.privoxy.org/show-url-info</a></p>
</blockquote>
</li>
<li>
<p>Toggle Privoxy on or off. This feature can be turned off/on in
the main <tt class="FILENAME">config</tt> file. When toggled
<span class="QUOTE">"off"</span>, <span class=
"QUOTE">"Privoxy"</span> continues to run, but only as a
pass-through proxy, with no actions taking place:</p><a name=
<li>
<p>Toggle Privoxy on or off. This feature can be turned off/on in
the main <tt class="FILENAME">config</tt> file. When toggled
<span class="QUOTE">"off"</span>, <span class=
"QUOTE">"Privoxy"</span> continues to run, but only as a
pass-through proxy, with no actions taking place:</p><a name=
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle" target=
"_top">http://config.privoxy.org/toggle</a></p>
</blockquote>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle" target=
"_top">http://config.privoxy.org/toggle</a></p>
</blockquote>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle?set=disable" target=
"_top">http://config.privoxy.org/toggle?set=disable</a></p>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle?set=disable" target=
"_top">http://config.privoxy.org/toggle?set=disable</a></p>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle?set=enable" target=
"_top">http://config.privoxy.org/toggle?set=enable</a></p>
<blockquote class="BLOCKQUOTE">
<p><a href="http://config.privoxy.org/toggle?set=enable" target=
"_top">http://config.privoxy.org/toggle?set=enable</a></p>
<p>Let's take a quick look at how some of <span class=
"APPLICATION">Privoxy's</span> core features are triggered, and the
ensuing sequence of events when a web page is requested by your
browser:</p>
<p>Let's take a quick look at how some of <span class=
"APPLICATION">Privoxy's</span> core features are triggered, and the
ensuing sequence of events when a web page is requested by your
browser:</p>
which will in turn, relay the request to the remote web server
after passing the following tests:</p>
</li>
which will in turn, relay the request to the remote web server
after passing the following tests:</p>
</li>
<li>
<p><span class="APPLICATION">Privoxy</span> traps any request for
its own internal CGI pages (e.g <a href="http://p.p/" target=
"_top">http://p.p/</a>) and sends the CGI page back to the
browser.</p>
</li>
<li>
<p><span class="APPLICATION">Privoxy</span> traps any request for
its own internal CGI pages (e.g <a href="http://p.p/" target=
"_top">http://p.p/</a>) and sends the CGI page back to the
browser.</p>
</li>
<li>
<p>Next, <span class="APPLICATION">Privoxy</span> checks to see if
the URL matches any <a href="actions-file.html#BLOCK"><span class=
<li>
<p>Next, <span class="APPLICATION">Privoxy</span> checks to see if
the URL matches any <a href="actions-file.html#BLOCK"><span class=
"QUOTE">"+set-image-blocker"</span></a> (blank, checkerboard
pattern, or an HTTP redirect to an image elsewhere).</p>
</li>
"QUOTE">"+set-image-blocker"</span></a> (blank, checkerboard
pattern, or an HTTP redirect to an image elsewhere).</p>
</li>
<li>
<p>Untrusted URLs are blocked. If URLs are being added to the
<tt class="FILENAME">trust</tt> file, then that is done.</p>
</li>
<li>
<p>Untrusted URLs are blocked. If URLs are being added to the
<tt class="FILENAME">trust</tt> file, then that is done.</p>
</li>
<li>
<p>If the URL pattern matches the <a href=
"actions-file.html#FAST-REDIRECTS"><span class=
"QUOTE">"+fast-redirects"</span></a> action, it is then processed.
Unwanted parts of the requested URL are stripped.</p>
</li>
<li>
<p>If the URL pattern matches the <a href=
"actions-file.html#FAST-REDIRECTS"><span class=
"QUOTE">"+fast-redirects"</span></a> action, it is then processed.
Unwanted parts of the requested URL are stripped.</p>
</li>
<li>
<p>Now the rest of the client browser's request headers are
processed. If any of these match any of the relevant actions (e.g.
<li>
<p>Now the rest of the client browser's request headers are
processed. If any of these match any of the relevant actions (e.g.
<li>
<p>First, the server headers are read and processed to determine,
among other things, the MIME type (document type) and encoding. The
<li>
<p>First, the server headers are read and processed to determine,
among other things, the MIME type (document type) and encoding. The
"actions-file.html#DOWNGRADE-HTTP-VERSION"><span class=
"QUOTE">"+downgrade-http-version"</span></a> actions.</p>
</li>
"actions-file.html#DOWNGRADE-HTTP-VERSION"><span class=
"QUOTE">"+downgrade-http-version"</span></a> actions.</p>
</li>
<li>
<p>If any <a href="actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a> action or <a href=
<li>
<p>If any <a href="actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a> action or <a href=
frame, depending on the action setting.The entire page, which is
now filtered, is then sent by <span class=
"APPLICATION">Privoxy</span> back to your browser.</p>
frame, depending on the action setting.The entire page, which is
now filtered, is then sent by <span class=
"APPLICATION">Privoxy</span> back to your browser.</p>
<p>If neither a <a href="actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a> action or <a href=
"actions-file.html#DEANIMATE-GIFS"><span class=
<p>If neither a <a href="actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a> action or <a href=
"actions-file.html#DEANIMATE-GIFS"><span class=
"APPLICATION">Privoxy</span> passes the raw data through to the
client browser as it becomes available.</p>
</li>
"APPLICATION">Privoxy</span> passes the raw data through to the
client browser as it becomes available.</p>
</li>
<li>
<p>As the browser receives the now (possibly filtered) page
content, it reads and then requests any URLs that may be embedded
<li>
<p>As the browser receives the now (possibly filtered) page
content, it reads and then requests any URLs that may be embedded
<p>NOTE: This is somewhat of a simplistic overview of what happens with
each URL request. For the sake of brevity and simplicity, we have
focused on <span class="APPLICATION">Privoxy's</span> core features
only.</p>
</div>
<p>NOTE: This is somewhat of a simplistic overview of what happens with
each URL request. For the sake of brevity and simplicity, we have
focused on <span class="APPLICATION">Privoxy's</span> core features
only.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><a name="ACTIONSANAT" id="ACTIONSANAT">14.4.
Troubleshooting: Anatomy of an Action</a></h2>
<div class="SECT2">
<h2 class="SECT2"><a name="ACTIONSANAT" id="ACTIONSANAT">14.4.
Troubleshooting: Anatomy of an Action</a></h2>
<p>The way <span class="APPLICATION">Privoxy</span> applies <a href=
"actions-file.html#ACTIONS">actions</a> and <a href=
"actions-file.html#FILTER">filters</a> to any given URL can be complex,
<p>The way <span class="APPLICATION">Privoxy</span> applies <a href=
"actions-file.html#ACTIONS">actions</a> and <a href=
"actions-file.html#FILTER">filters</a> to any given URL can be complex,
actions and filters files themselves, since they tend to be filled with
<a href="appendix.html#REGEX">regular expressions</a> whose
consequences are not always so obvious.</p>
actions and filters files themselves, since they tend to be filled with
<a href="appendix.html#REGEX">regular expressions</a> whose
consequences are not always so obvious.</p>
<p>One quick test to see if <span class="APPLICATION">Privoxy</span> is
causing a problem or not, is to disable it temporarily. This should be
the first troubleshooting step (be sure to flush caches afterward!).
<p>One quick test to see if <span class="APPLICATION">Privoxy</span> is
causing a problem or not, is to disable it temporarily. This should be
the first troubleshooting step (be sure to flush caches afterward!).
feature and logging are enabled via <tt class="FILENAME">config</tt>
file settings, and may need to be turned <span class=
"QUOTE">"on"</span>.)</p>
feature and logging are enabled via <tt class="FILENAME">config</tt>
file settings, and may need to be turned <span class=
"QUOTE">"on"</span>.)</p>
<p>Another easy troubleshooting step to try is if you have done any
customization of your installation, revert back to the installed
defaults and see if that helps. There are times the developers get
complaints about one thing or another, and the problem is more related
to a customized configuration issue.</p>
<p>Another easy troubleshooting step to try is if you have done any
customization of your installation, revert back to the installed
defaults and see if that helps. There are times the developers get
complaints about one thing or another, and the problem is more related
to a customized configuration issue.</p>
<p><span class="APPLICATION">Privoxy</span> also provides the <a href=
"http://config.privoxy.org/show-url-info" target=
"_top">http://config.privoxy.org/show-url-info</a> page that can show
us very specifically how <span class="APPLICATION">actions</span> are
being applied to any given URL. This is a big help for
troubleshooting.</p>
<p><span class="APPLICATION">Privoxy</span> also provides the <a href=
"http://config.privoxy.org/show-url-info" target=
"_top">http://config.privoxy.org/show-url-info</a> page that can show
us very specifically how <span class="APPLICATION">actions</span> are
being applied to any given URL. This is a big help for
troubleshooting.</p>
<p>First, enter one URL (or partial URL) at the prompt, and then
<span class="APPLICATION">Privoxy</span> will tell us how the current
configuration will handle it. This will not help with filtering effects
<p>First, enter one URL (or partial URL) at the prompt, and then
<span class="APPLICATION">Privoxy</span> will tell us how the current
configuration will handle it. This will not help with filtering effects
those out of the HTML source. Use your browser's <span class=
"QUOTE">"View Page Source"</span> option for this. Or right click on
the ad, and grab the URL.</p>
those out of the HTML source. Use your browser's <span class=
"QUOTE">"View Page Source"</span> option for this. Or right click on
the ad, and grab the URL.</p>
<p>Let's try an example, <a href="http://google.com" target=
"_top">google.com</a>, and look at it one section at a time in a sample
configuration (your real configuration may vary):</p>
<p>Let's try an example, <a href="http://google.com" target=
"_top">google.com</a>, and look at it one section at a time in a sample
configuration (your real configuration may vary):</p>
In file: default.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
In file: default.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
In file: user.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
In file: user.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
<p>This is telling us how we have defined our <a href=
"actions-file.html#ACTIONS"><span class="QUOTE">"actions"</span></a>,
and which ones match for our test case, <span class=
<p>This is telling us how we have defined our <a href=
"actions-file.html#ACTIONS"><span class="QUOTE">"actions"</span></a>,
and which ones match for our test case, <span class=
"QUOTE">"on"</span> here, but many are <span class=
"QUOTE">"off"</span>. Each example we try may provide a slightly
different end result, depending on our configuration directives.</p>
"QUOTE">"on"</span> here, but many are <span class=
"QUOTE">"off"</span>. Each example we try may provide a slightly
different end result, depending on our configuration directives.</p>
<p>The first listing is for our <tt class=
"FILENAME">default.action</tt> file. The large, multi-line listing, is
how the actions are set to match for all URLs, i.e. our default
<p>The first listing is for our <tt class=
"FILENAME">default.action</tt> file. The large, multi-line listing, is
how the actions are set to match for all URLs, i.e. our default
"QUOTE">"aliases"</span> section near the top. This will apply to all
URLs as signified by the single forward slash at the end of the listing
-- <span class="QUOTE">" / "</span>.</p>
"QUOTE">"aliases"</span> section near the top. This will apply to all
URLs as signified by the single forward slash at the end of the listing
-- <span class="QUOTE">" / "</span>.</p>
<p>But we have defined additional actions that would be exceptions to
these general rules, and then we list specific URLs (or patterns) that
these exceptions would apply to. Last match wins. Just below this then
<p>But we have defined additional actions that would be exceptions to
these general rules, and then we list specific URLs (or patterns) that
these exceptions would apply to. Last match wins. Just below this then
in the lower part of our <tt class="FILENAME">default.action</tt> file,
and <span class="QUOTE">"google.com"</span> is referenced somewhere in
these latter sections.</p>
in the lower part of our <tt class="FILENAME">default.action</tt> file,
and <span class="QUOTE">"google.com"</span> is referenced somewhere in
these latter sections.</p>
<p>Then, for our <tt class="FILENAME">user.action</tt> file, we again
have no hits. So there is nothing google-specific that we might have
added to our own, local configuration. If there was, those actions
<p>Then, for our <tt class="FILENAME">user.action</tt> file, we again
have no hits. So there is nothing google-specific that we might have
added to our own, local configuration. If there was, those actions
<tt class="FILENAME">default.action</tt>. <tt class=
"FILENAME">user.action</tt> typically has the last word. This is the
best place to put hard and fast exceptions,</p>
<tt class="FILENAME">default.action</tt>. <tt class=
"FILENAME">user.action</tt> typically has the last word. This is the
best place to put hard and fast exceptions,</p>
<p>And finally we pull it all together in the bottom section and
summarize how <span class="APPLICATION">Privoxy</span> is applying all
its <span class="QUOTE">"actions"</span> to <span class=
"QUOTE">"google.com"</span>:</p>
<p>And finally we pull it all together in the bottom section and
summarize how <span class="APPLICATION">Privoxy</span> is applying all
its <span class="QUOTE">"actions"</span> to <span class=
"QUOTE">"google.com"</span>:</p>
<p>Notice the only difference here to the previous listing, is to
<span class="QUOTE">"fast-redirects"</span> and <span class=
"QUOTE">"session-cookies-only"</span>, which are activated specifically
for this site in our configuration, and thus show in the <span class=
"QUOTE">"Final Results"</span>.</p>
<p>Notice the only difference here to the previous listing, is to
<span class="QUOTE">"fast-redirects"</span> and <span class=
"QUOTE">"session-cookies-only"</span>, which are activated specifically
for this site in our configuration, and thus show in the <span class=
"QUOTE">"Final Results"</span>.</p>
<p>Now another example, <span class=
"QUOTE">"ad.doubleclick.net"</span>:</p>
<p>Now another example, <span class=
"QUOTE">"ad.doubleclick.net"</span>:</p>
<p>We'll just show the interesting part here - the explicit matches. It
is matched three different times. Two <span class=
"QUOTE">"+block{}"</span> sections, and a <span class="QUOTE">"+block{}
<p>We'll just show the interesting part here - the explicit matches. It
is matched three different times. Two <span class=
"QUOTE">"+block{}"</span> sections, and a <span class="QUOTE">"+block{}
"actions-file.html#ALIASES"><span class="QUOTE">"Aliases"</span></a>
are defined in the first section of the actions file and typically used
to combine more than one action.)</p>
"actions-file.html#ALIASES"><span class="QUOTE">"Aliases"</span></a>
are defined in the first section of the actions file and typically used
to combine more than one action.)</p>
<p>Any one of these would have done the trick and blocked this as an
unwanted image. This is unnecessarily redundant since the last case
effectively would also cover the first. No point in taking chances with
<p>Any one of these would have done the trick and blocked this as an
unwanted image. This is unnecessarily redundant since the last case
effectively would also cover the first. No point in taking chances with
"QUOTE">"+handle-as-image"</span></a>. The custom alias <span class=
"QUOTE">"<tt class="LITERAL">+block-as-image</tt>"</span> just
simplifies the process and make it more readable.</p>
"QUOTE">"+handle-as-image"</span></a>. The custom alias <span class=
"QUOTE">"<tt class="LITERAL">+block-as-image</tt>"</span> just
simplifies the process and make it more readable.</p>
<p>One last example. Let's try <span class=
"QUOTE">"http://www.example.net/adsl/HOWTO/"</span>. This one is giving
us problems. We are getting a blank page. Hmmm ...</p>
<p>One last example. Let's try <span class=
"QUOTE">"http://www.example.net/adsl/HOWTO/"</span>. This one is giving
us problems. We are getting a blank page. Hmmm ...</p>
In file: default.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
In file: default.action <span class="GUIBUTTON">[ View ]</span> <span class=
"GUIBUTTON">[ Edit ]</span>
<p>Ooops, the <span class="QUOTE">"/adsl/"</span> is matching
<span class="QUOTE">"/ads"</span> in our configuration! But we did not
want this at all! Now we see why we get the blank page. It is actually
<p>Ooops, the <span class="QUOTE">"/adsl/"</span> is matching
<span class="QUOTE">"/ads"</span> in our configuration! But we did not
want this at all! Now we see why we get the blank page. It is actually
paths with <span class="QUOTE">"adsl"</span> in them (remember, last
match in the configuration wins). There are various ways to handle such
exceptions. Example:</p>
paths with <span class="QUOTE">"adsl"</span> in them (remember, last
match in the configuration wins). There are various ways to handle such
exceptions. Example:</p>
<p>Now the page displays ;-) Remember to flush your browser's caches
when making these kinds of changes to your configuration to insure that
you get a freshly delivered page! Or, try using <tt class=
"LITERAL">Shift+Reload</tt>.</p>
<p>Now the page displays ;-) Remember to flush your browser's caches
when making these kinds of changes to your configuration to insure that
you get a freshly delivered page! Or, try using <tt class=
"LITERAL">Shift+Reload</tt>.</p>
<p>That actually was very helpful and pointed us quickly to where the
problem was. If you don't get this kind of match, then it means one of
the default rules in the first section of <tt class=
<p>That actually was very helpful and pointed us quickly to where the
problem was. If you don't get this kind of match, then it means one of
the default rules in the first section of <tt class=
for the site to one of aliases that turn off <a href=
"actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a>:</p>
for the site to one of aliases that turn off <a href=
"actions-file.html#FILTER"><span class=
"QUOTE">"+filter"</span></a>:</p>
<p><span class="QUOTE">"<tt class="LITERAL">{ shop }</tt>"</span> is an
<span class="QUOTE">"alias"</span> that expands to <span class=
"QUOTE">"<tt class="LITERAL">{ -filter -session-cookies-only
}</tt>"</span>. Or you could do your own exception to negate
filtering:</p>
<p><span class="QUOTE">"<tt class="LITERAL">{ shop }</tt>"</span> is an
<span class="QUOTE">"alias"</span> that expands to <span class=
"QUOTE">"<tt class="LITERAL">{ -filter -session-cookies-only
}</tt>"</span>. Or you could do your own exception to negate
filtering:</p>
<p>This would turn off all filtering for these sites. This is best put
in <tt class="FILENAME">user.action</tt>, for local site exceptions.
Note that when a simple domain pattern is used by itself (without the
subsequent path portion), all sub-pages within that domain are included
automatically in the scope of the action.</p>
<p>This would turn off all filtering for these sites. This is best put
in <tt class="FILENAME">user.action</tt>, for local site exceptions.
Note that when a simple domain pattern is used by itself (without the
subsequent path portion), all sub-pages within that domain are included
automatically in the scope of the action.</p>
<p>Images that are inexplicably being blocked, may well be hitting the
<a href="actions-file.html#FILTER-BANNERS-BY-SIZE"><span class=
"QUOTE">"+filter{banners-by-size}"</span></a> rule, which assumes that
images of certain sizes are ad banners (works well <span class=
"emphasis"><i class="EMPHASIS">most of the time</i></span> since these
tend to be standardized).</p>
<p>Images that are inexplicably being blocked, may well be hitting the
<a href="actions-file.html#FILTER-BANNERS-BY-SIZE"><span class=
"QUOTE">"+filter{banners-by-size}"</span></a> rule, which assumes that
images of certain sizes are ad banners (works well <span class=
"emphasis"><i class="EMPHASIS">most of the time</i></span> since these
tend to be standardized).</p>
<p><span class="QUOTE">"<tt class="LITERAL">{ fragile }</tt>"</span> is
an alias that disables most actions that are the most likely to cause
trouble. This can be used as a last resort for problem sites.</p>
<p><span class="QUOTE">"<tt class="LITERAL">{ fragile }</tt>"</span> is
an alias that disables most actions that are the most likely to cause
trouble. This can be used as a last resort for problem sites.</p>
<p><span class="emphasis"><i class="EMPHASIS">Remember to flush
caches!</i></span> Note that the <tt class="LITERAL">mail.google</tt>
reference lacks the TLD portion (e.g. <span class=
"QUOTE">".com"</span>). This will effectively match any TLD with
<tt class="LITERAL">google</tt> in it, such as <tt class=
"LITERAL">mail.google.de.</tt>, just as an example.</p>
<p><span class="emphasis"><i class="EMPHASIS">Remember to flush
caches!</i></span> Note that the <tt class="LITERAL">mail.google</tt>
reference lacks the TLD portion (e.g. <span class=
"QUOTE">".com"</span>). This will effectively match any TLD with
<tt class="LITERAL">google</tt> in it, such as <tt class=
"LITERAL">mail.google.de.</tt>, just as an example.</p>
<p>If this still does not work, you will have to go through the
remaining actions one by one to find which one(s) is causing the
problem.</p>
</div>
</div>
<p>If this still does not work, you will have to go through the
remaining actions one by one to find which one(s) is causing the
problem.</p>
</div>
</div>
<table summary="Footer navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="seealso.html"
accesskey="P">Prev</a></td>
<table summary="Footer navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="seealso.html"
accesskey="P">Prev</a></td>