0

I want to redirect all HTTP requests to HTTPS as well as redirect all www requests to non-www.

The reason for this is that I want SSL to be forced and I am currently unable to support SSL on my www subdomain.

This solution needs to support all combinations of HTTP, HTTPS, www and non-www. The best solutions I have found so far supports all combinations except www and HTTPS at the same time.

Thank you for your time. :)

EDIT: Just to explicitly state it once again, to avoid any more incorrect duplication suggestion: I want to redirect from www to non-www not the other way around. I also want to force SSL at the same time.

marked as duplicate by MrWhite, John Conde Sep 12 '15 at 2:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • "except www and HTTPS at the same time" - You won't be able to redirect www and HTTPS if your certificate does not support this. That's the point of the SSL cert - it kicks in before everything else, so you'll get the cert warning before your site is able to deal with the request. – MrWhite Sep 11 '15 at 23:51
  • So what if I redirect to non-www and THEN to SSL? And in some way exclude www from even using the certificate in the first place? – MaverickMartyn Sep 11 '15 at 23:57
  • I have an example of what you are asking for here: webmasters.stackexchange.com/questions/72317/… – closetnoc Sep 12 '15 at 0:00
  • Although the problem you state is if somebody navigates to https://www.example.com - unless your cert supports the www subdomain then you can't redirect anything in this instance. Otherwise you can use the existing solutions. – MrWhite Sep 12 '15 at 0:02