Forum Moderators: phranque

Message Too Old, No Replies

Apache ssl install question

         

born2run

1:13 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So I have an apache server and trying to install SSL on it.

In my setup whenever I type example.com in my browser it goes to www.example.com.

Now my question is that if I install SSL I have a redirect for http://www.example.com to https://www.example.com

In this scenario if a user opens example.com would there be 2 redirects then? One to www and other to SSL url?

Is this setup correct? What's the best way to implement SSL in this scenario? Thanks!

phranque

1:21 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



make sure the redirect to www,example.com specifies the https: schema (protocol).

look for RewriteRule directives in your .htaccess file.

keyplyr

1:30 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



@born2run - you keep using the term "SSL"

SSL is no longer used. In fact it is prohibited from use by the Internet Engineering Task Force.

What we use now is TLS. [en.m.wikipedia.org...]

born2run

1:48 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ok TLS so two redirects are fine if someone opens browser via example.com ?

lucy24

2:56 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



if a user opens example.com would there be 2 redirects then? One to www and other to SSL url?
Only if the site's redirects are ineptly coded. Both should be part of the same redirect, with two [OR]-delimited conditions, assuming you're doing it with a RewriteRule. If the user requests the wrong form of the domain name, and/or they use the wrong protocol, they should be correctly redirected in one fell swoop.

phranque

3:04 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



so two redirects are fine

no.
make sure the redirect to www.example.com specifies the https: schema (protocol).

look for RewriteRule directives in your .htaccess file.

you don't want one redirect from example.com to http://www.example.com/ and then a subsequent redirect from http://www.example.com/ to https://www.example.com/

born2run

4:14 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ok so example.com goes to https://www.example.com
example.net goes to https://www.example.com
www.example.net goes to https://www.example.com

Sounds good?

not2easy

5:01 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If you are redirecting example.net to example.com you would use the same type of [OR] condition to rewrite both example.net and www.example.net to the preferred version https://www.example.com by adding that rewrite to the .htaccess file at example.net. That is separate from the canonical/secure rewrite at the example.com domain.

lucy24

5:07 am on Apr 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If example.net is functioning as a typo domain for-insurance-purposes, then it's all good.

Edit: That's assuming the DNS for .com and .net points to the same place. If that's the situation, then you don't even need to add a RewriteCond.

phranque

12:47 pm on Apr 17, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sounds good?

yes!

born2run

7:08 pm on Apr 18, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks tls is working and my other domains are forwarding properly thanks to you guys!