0

I have installed TURN server. And APACHE is also installed there. SSL Certificates are also installed. The site is running fine where I am typing https://www.domain.com or https://domain.com

But if I type only www.domain.com or domain.com it is saying "TURN Server use https connection for the admin session".

All I want, if someone types the URL without HTTPS, it will redirect it to HTTPS URL.

It is a server where TURN Server is also installed ( Repeating it again )

Arpan Nag
  • 11
  • 4

1 Answers1

0

I think this link can help.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The Apache doc recommend this:

<VirtualHost *:80>
    ServerName www.example.com
    Redirect / https://www.example.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName www.example.com
    # ... SSL configuration goes here
</VirtualHost>
Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53
  • Is it TURN Server independent ? – Arpan Nag Dec 13 '16 at 12:34
  • Yes, but, In the case of the http-to-https redirection, the use of `RewriteRule` would be appropriate if you don't have access to the main server configuration file, and are obliged to perform this task in a .htaccess file instead. – Sayuri Mizuguchi Dec 13 '16 at 12:37
  • Didn't work. It seems port 80 is not accessible by Apache2 anymore. It is now controlled by Turn Server. That's why it is not working. – Arpan Nag Dec 13 '16 at 13:41
  • Please check the [link](http://stackoverflow.com/questions/30984670/apprtc-with-coturn-stun-turn-server) – Sayuri Mizuguchi Dec 13 '16 at 13:47