Re:Ask HN: How can a website copy mine in real time?
by roosgit on Thursday May 30, 2024 @08:27AM
(#40522881)
I had a similar thing happen to one of my websites. In Varnish I used something like this:
if (req.http.host ~ "^(?i)(example.com|www.example.com)") {
#redirect to https
}
else {
return(synth(403, "Not allowed."));
}
It basically checks if the host is my domain. I don’t know know what the equivalent of `req.http.host` is on the web server you use. This "solution" might run into issues with Google Translate, but I’m not sure.
if (req.http.host ~ "^(?i)(example.com|www.example.com)") { #redirect to https } else { return(synth(403, "Not allowed.")); }
It basically checks if the host is my domain. I don’t know know what the equivalent of `req.http.host` is on the web server you use. This "solution" might run into issues with Google Translate, but I’m not sure.