SSL setup issues on Moodle 3.2.3

SSL setup issues on Moodle 3.2.3

Yogesh Nahar發表於
Number of replies: 4

Hello Moodlers,

I am trying to setup SSL on my entire Moodle site. I have bought a Comodo issued wildcard SSL certificate via my host Blue Host account.

The details of my server setup are:

Blue Host Cloud Hosting | Moodle 3.2.3 | PHP 5.6.29 | MySQL 5.6.32 | Wildcard SSL cert (Comodo)

Moodle hosted on a sub-domain: academy.carterradley.com

Carterradley.com is the main domain on the account. When checking SSL Shopper, the certificate seems to be installed correctly on the sub-domain (http://academy.carterradley.com). Screenshot attached. 

So the next steps was to change the moodle config: 

1. Changed the wwwroot in config,php  to https 

2. tried to Add/append to a .htaccess file in the Moodle root directory:

https:// redirect.

RewriteEngine On 

RewriteCond %{SERVER_PORT} 80 

RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]

3. Also, changed the loginhttps option to yes and cookies to secure in Moodle administration menu.

So after making all the above changes, I tried to visit https://academy.carterradley.com and it was for some reason redirecting to https://www.carterradley.com. I have no clue why this is happening and nor have blue host reps been able to figure it out. There is no redirection of any sort in any htaccess file or any place else. 

But if I visited http://academy.carterradley.com, then the Moodle site loads up and the 'Login' button links to the secure URL https://academy.carterradley.com, but ofcourse redirects immediately like the above. 

Also, I'd like to point out that at one point when we set the above, the Moodle site loaded at the secure URL but was broken, so I am assuming the css and javascript were missing. 

Is there any advice the community could give me to test any other method to get SSL working on our Moodle site? If you have come across the same issue or something advice from your experience, would really appreciate that. 

Thank you. 

附件 sslverify.png
評比平均分數: -
In reply to Yogesh Nahar

Re: SSL setup issues on Moodle 3.2.3

Dave Perry發表於

Not knowing that provider, do they give you access to the vhost configuration? I would have thought it would be better to have all your vhost/ssl config in the two files in there so you can see everything it's doing at once.

If not, ask them to set it up? Generally I find it easier to just pay the hosting outfit to arrange and configure your SSL when using them - we run our own server so do all that stuff in the apache config (IT bought a wildcard certificate that is on our reverse proxy, we just converted it to Apache format).

In reply to Yogesh Nahar

Re: SSL setup issues on Moodle 3.2.3

David Dinh發表於

Yogesh Nahar, 


Were you able to fix the SSL on a subdomain issue?  I am having the same exact issue on the hostmonster host server and don't know how to resolve it.  Any help would be appreciated.


Thanks

In reply to Yogesh Nahar

Re: SSL setup issues on Moodle 3.2.3

David Dinh發表於

Yogesh Nahar, 


Were you able to fix the SSL on a subdomain issue?  I am having the same exact issue on the hostmonster host server and don't know how to resolve it.  Any help would be approximated.


Thanks

In reply to Yogesh Nahar

Re: SSL setup issues on Moodle 3.2.3

Harsh Patel發表於

Hi,


www.carterradley.com will have its own .index and .htaccess file and  academy.carterradley.com  will have its own .index and .htaccess file. If not then you need to make one else the changes you are making in htaccess are taking place globally and not at local level. 

Use this code for htaccess of www.carterradley.com

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?carterradley\.com$
RewriteRule (.*) https://www.carterradley.com/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^carterradley\.com$
RewriteRule (.*) https://www.carterradley.com/$1 [R=301,L]



Use this code for htaccess of academy.carterradley.com

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(academy\.)?carterradley\.com$
RewriteRule (.*) https://academy.carterradley.com/$1 [R=301,L]