Claim your Biolink Click Here
1 like 0 dislike
452 views
in Education & Reference by (4.7k points) | 452 views

1 Answer

1 like 0 dislike
Best answer
vi /etc/httpd/conf/httpd.conf

<VirtualHost *:80>

     RewriteEngine On

     RewriteCond %{HTTPS} off

     #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

     ServerAdmin root@localhost

     DocumentRoot /var/www/html/

     ServerName subdomain57.domain.com

     ServerAlias subdomain57.domain.com

     ErrorLog /var/www/html/error.log

RewriteCond %{SERVER_NAME} =subdomain57.domain.com

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

</VirtualHost>



Include /etc/httpd/conf/httpd-le-ssl.conf

------------------------------------------------------------------

vi /etc/httpd/conf/httpd-le-ssl.conf

<IfModule mod_ssl.c>

<VirtualHost *:443>

     RewriteEngine On

# Some rewrite rules in this file were disabled on your HTTPS site,

# because they have the potential to create redirection loops.



#      RewriteCond %{HTTPS} off

#      #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

#      ServerAdmin root@localhost

#      DocumentRoot /var/www/html/

#      ServerName subdomain57.domain.com

#      ServerAlias subdomain57.domain.com

#      ErrorLog /var/www/html/error.log

# RewriteCond %{SERVER_NAME} =subdomain57.domain.com

# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

ServerName subdomain57.domain.com

Include /etc/letsencrypt/options-ssl-apache.conf

SSLCertificateFile /etc/letsencrypt/live/subdomain57.domain.com/cert.pem

SSLCertificateKeyFile /etc/letsencrypt/live/subdomain57.domain.com/privkey.pem

SSLCertificateChainFile /etc/letsencrypt/live/subdomain57.domain.com/chain.pem

</VirtualHost>

</IfModule>
by (1.6k points)
selected by

Related questions

3 like 0 dislike
1 answer
asked May 27, 2021 in Education & Reference by Yogi (460 points) | 547 views
0 like 0 dislike
1 answer
0 like 0 dislike
0 answers
0 like 0 dislike
1 answer
asked Oct 23, 2018 in Education & Reference by Krish (1.1k points) | 375 views
2 like 0 dislike
10 answers
asked Oct 23, 2018 in Education & Reference by Sam (1.6k points) | 1.5k views
2 like 0 dislike
2 answers
asked May 30, 2020 in Education & Reference by john (80 points) | 563 views
0 like 0 dislike
1 answer
asked Sep 5, 2019 in Computers & Internet by Neha (1.1k points) | 255 views
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
3 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,310 questions
1,471 answers
569 comments
4,809 users