1

I have a domain domain.org

I am adding SSL, unforunately a lot of subdomain where created as "www.subdomain" and it is way more expensive to create certificate to multiple 3 level subdomains.

Is it possible to redirect www.subdomain.domain.org to subdomain.domain.org without redirecting for www.domain.org?

Sylario
  • 101
  • 1
  • 11

1 Answers1

2

Yes, check out the Apache 2.2 doc for mod_rewrite:

Apache Module mod_rewrite

Also check this serverfault post: Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to Ask

But remember. SSL is negotiated before URL rewriting, so you will get a CN mismatch error on your browsers.

You can consider buying an SSL wildcard certificate, which covers all subdomains whitin a domain. But this certificates are more expensive than traditional certs.

Regards

mvillar
  • 428
  • 6
  • 19