[HTTPS-Everywhere] What does "([^/:@\.]+)\" and "$1" do?

Andrew Sillers apsillers at gmail.com
Tue Aug 16 13:38:45 PDT 2011


Victor,

Try removing the "\." before "faxzero" and adding a question mark in its
place: ([^/:@\.]+)?

Similarly, eliminate the "\." before "faxzero" in the "to" part of the rule.

Right now, your rule requires something to precede the main domain; the
question mark will make a subdomain optional.  (Specifically, ([^/:@\.]+)
grabs all subdommains and excludes authentication credentials, which use "@"
and ":".)

The $1 is a regular expression backreference (
http://www.regular-expressions.info/brackets.html), which is used to
represent the first parenthesized clause in the "from" regex -- in this
case, all the subdomains, grabbed by ([^/:@\.]+).

Andrew

On Tue, Aug 16, 2011 at 4:19 PM, Victor Garin <vic.garin at gmail.com> wrote:

> When I started, I used the below rule as an example, because it used
> to encrypt all the subdomains:
>
> <ruleset name="Netflix">
>  <target host="netflix.com" />
>  <target host="*.netflix.com" />
>  <rule from="^http://([^/:@\.]+)\.netflix\.com/" to="https://$
> 1.netflix.com/"/>
> </ruleset>
>
> I assumed it also encrypted the main domain, but that doesn't seem to
> be the case for example here:
>
> <ruleset name="FaxZero">
>  <target host="faxzero.com" />
>  <target host="*.faxzero.com" />
>  <rule from="^http://([^/:@\.]+)\.faxzero\.com/" to="https://$
> 1.faxzero.com/"/>
> </ruleset>
>
>
> i.e. browsing to http://faxzero.com does nothing?
>
> What does "([^/:@\.]+)\" and "$1" do?
>
> Is there a way, to write in the same line, to redirect the main domain
> to https also? Or does the main domain rule, have to be in a new line?
> _______________________________________________
> HTTPS-everywhere mailing list
> HTTPS-everywhere at mail1.eff.org
> https://mail1.eff.org/mailman/listinfo/https-everywhere
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.eff.org/pipermail/https-everywhere/attachments/20110816/c6c7d6a5/attachment.html>


More information about the HTTPS-everywhere mailing list