Mobile app version of vmapp.org
Login or Join
Shakeerah822

: How can I disable the certificate/SSL handshake on the 'www' version of my site served by Apache? We use SSL on the https://www version of our website. Now I would like to disable the SSL

@Shakeerah822

Posted in: #Apache #Htaccess #HttpdConf #Https

We use SSL on the www version of our website.

Now I would like to disable the SSL connection on the non-www version of our website, so the result is:

non-www => SSL handshake www => no SSL


Can this be done?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shakeerah822

1 Comments

Sorted by latest first Latest Oldest Best

 

@Chiappetta492

You could do this in your .htaccess file:

RewriteEngine on

# if https and starts with www, go to http version
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^www [NC]
RewriteRule ^(.*)$ %{SERVER_NAME}%{REQUEST_URI} [L,R=301]

# if not https and it doesnt start with www, go to https version
RewriteCond %{SERVER_PORT} !^80$
RewriteCond %{HTTP_HOST} !^www [NC]
RewriteRule ^(.*)$ %{SERVER_NAME}%{REQUEST_URI} [L,R=301]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme