
It should be noted that this example will not work for requests with destination URLs specified with an IP address
for a hostname (e.g.,"12.34.56.78" instead of "www.example.com"). Providing support for IP addresses in URLs
as well as DNS host names would involve either: a more complex regular expression that matches both; or, an
additional Responder with a regular expression that matches IP addresses, as well as two match rules to match
the two types of host names (so that the appropriate Responder replies to the client).
Example 3 - Directory Redirect
The next example involves redirecting requests that include a particular directory to a different domain, omitting the
directory from the redirect URL’s path. Let’s say we want all requests for:
http://www.example.com/images/<path>
to be redirected to:
http://images.example.com/<path>
The following regular expression:
(([^ :/?#]+):)?//([^ \r/?#.]+)?.([^ \r/?#.]+)?.([^ \r/?#]+)?(/[^ \r]+)?(/[^ \r]+)
breaks the request URL into the following named variables:
$0 http://www.example.com/images/<path>
$1 http
$2 http:
$3 www
$4 example
$5 com
$6 /images
$7 /<path>
We can then use these variables in the URL field as shown in the following Responder Configuration screen
(tab):
Copyright © 2013 Coyote Point Systems. A subsidiary of Fortinet, Inc.
All Rights Reserved.
353
Equalizer Administration Guide
Comentários a estes Manuais