The “www” part is probably causing a problem too. As the regex is
written it will only match “www...” which I’m
guessing isn’t what you intent. I would instead treat “www” as another
possible subdomain.
~^(?[^.].)?(?[^.]).(?[^.*)$
Note I haven’t tested this, but it’s similar to a pattern I’ve used. The
$subdomain variable will be either the subdomain, “www”, or will be
empty. It would need some more tweaking to handle multiple subdomains
(one.two.domain.com).
What is the working form of this? I want to redirect all ..* to .
(e.g.
sub.domain.tld to domain.tld) because I have different domains and
tdls.
Any help appreciated.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.