You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Does HTTPS Everywhere allow rules that redirect to a different domain? #4273
I ran into a problem visiting http://www.virusbtn.com/. That site switched to a new domain, which is https://www.virusbulletin.com/. The first uses HTTP which uses a Location header to point their HTTPS domain. So visiting their HTTP site attempts to redirect the visitor to their new but different domained HTTPS site.
I looked in the rules in HTTPS Everywhere regarding the virusbtn.com site. All they do is change the http:// protocol to https:// but the virusbtn.com remains the same. I realize that it is considered a no-no to redirect to a different domain since that can be used as a covert tactic to get the visitor to a different site than they specified and the visitor may not notice the URL change in the address bar of their web browser. However, I also know that sites will sometimes use a new domain to build a new version of their site. When they are ready to go public with their new web site, they put the Location header in their old site's home page to push visitors to their new site.
Switching from HTTP to HTTPS can sometimes break a site, especially if the site does it which opens a window of vulnerability between the HTTP and HTTPS connects. Redirecting to a different domain can trigger an alert (by an aware user) that they may not be where they thought they would go. So I am wondering if HTTPS Everywhere allows its rules to not only change the protocol (from HTTP to HTTPS) but to also change to a different domain for, in this case, a new site to replace the old one and the new site implements HTTPS.
If redirecting to a different domain while changing the protocol is permitted in the rules then the rule for virusbtn.com is out of date. It should redirect http://www.virusbtn.com/ to https://www.virusbulletin.com.
Answering the question first of all: Not only is that allowed, it's actually pretty common. The most common use-case is for either adding or removing the "www" part of a hostname for a poorly configured domain. Another common one is for redirecting CDN buckets to their generic hostnames in which case certificates often do not cover the hosts the CDN delivers content to.
In both of those cases, it comes with a bit of a downside though, though, as it may break the site it attempts to fix the instant the site manager fixes their site themselves, so it is often better to not "help" the site too much, if it can be avoided.
In your specific case, we actually have to update the ruleset, since it looks like the https://www.virusbtn.com is misconfigured and could cause breakage:
$ curl https://virusbtn.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
$ curl https://www.virusbtn.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
I'm personally doing exactly this in one of my pull requests to get past ISP censorship which would block the server from automatically forwarding the user to the new domain.
However, that's unlikely to ever apply to this website, which automatically forwards the user to virusbulletin.com perfectly fine.
There is one problem that might arise. The cert for virusbtn.com expires in may, and they may decide not to bother renewing it. In this case, the rule would need updated to manually forward users to virusbulletin.com
Activity
fuglede commentedon Mar 6, 2016
Answering the question first of all: Not only is that allowed, it's actually pretty common. The most common use-case is for either adding or removing the "www" part of a hostname for a poorly configured domain. Another common one is for redirecting CDN buckets to their generic hostnames in which case certificates often do not cover the hosts the CDN delivers content to.
In both of those cases, it comes with a bit of a downside though, though, as it may break the site it attempts to fix the instant the site manager fixes their site themselves, so it is often better to not "help" the site too much, if it can be avoided.
One example could be the rule
In your specific case, we actually have to update the ruleset, since it looks like the https://www.virusbtn.com is misconfigured and could cause breakage:
funkydude commentedon Mar 6, 2016
I'm personally doing exactly this in one of my pull requests to get past ISP censorship which would block the server from automatically forwarding the user to the new domain.
However, that's unlikely to ever apply to this website, which automatically forwards the user to virusbulletin.com perfectly fine.
There is one problem that might arise. The cert for virusbtn.com expires in may, and they may decide not to bother renewing it. In this case, the rule would need updated to manually forward users to virusbulletin.com