Follow

How do I write about so all visitors coming to https?

The easiest way is to create a .htaccess file in the directory revamping will be done in the (usually public_html) and add there code that writes about the visit to your site to HTTPS protocol.

Here are some examples of how it can be done.

Writing about visits to https: //www.domain.com (the WWW)

RewriteEngine On # If not using www RewriteCond% {HTTP_HOST}! ^ Www. (. *) $ [NC] RewriteCond% {HTTP: HTTPS}! On RewriteRule. * Https: //www.% HTTP_HOST {}% {REQUEST_URI} [R, L] # If using www RewriteCond% {HTTP_HOST} ^ www. (. *) $ [NC] RewriteCond% {HTTP: HTTPS}! on RewriteRule. * https: //% {HTTP_HOST}% {REQUEST_URI} [ R, L]


Writing about visits to https: //domain.com (without WWW)

RewriteEngine On RewriteCond% {HTTP: HTTPS}! On RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R, L] # If using www RewriteCond% {HTTP_HOST} ^ www \. (. *) $ [ NC] RewriteCond% {HTTP: HTTPS}! on RewriteRule. * https: //domain.com% {REQUEST_URI} [R, L]


Note that here you have to replace "https: //domain.com" with your actual domain name.

Writing about visits both with and without the WWW

RewriteEngine On RewriteCond% {HTTP: HTTPS}! On RewriteRule. * Https: //% {HTTP_HOST}% {REQUEST_URI} [R, L]


Note that you can, in order to run HTTPS both with and without the WWW, you need to update both your A pointer to the IP address that apply to your SSL certificate.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.