SpaceCowboy

Well-Known Member
Jan 18, 2014
54
5
8
cPanel Access Level
Website Owner
Hi, i don't understand how these includes work.

If i got it right any change made directly to httpd.conf they will be lost on /scripts/rebuildhttpdconf

I am looking at this without understand how to actually do it.

At the end of the virtualhost i'm trying to edit it says:
# Include "/etc/apache2/conf.d/userdata/std/2_4/... <- This doesn't exist, and the include is a comment so... it won't pick it up even if create them.

All i want to do is add this to one of the VirtualHost:
Code:
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
        RewriteRule (.*) https://domain.com%{REQUEST_URI} [END,QSA,R=permanent]
  1. Where should this file be placed?
  2. How should the file be called?
  3. What should the file contain? A copy of the virtualhost modified? The entire httpd.conf modified?
 

SpaceCowboy

Well-Known Member
Jan 18, 2014
54
5
8
cPanel Access Level
Website Owner
Solved:
  1. Created /etc/apache2/conf.d/userdata/std/2_4/... directory.
  2. Created "ssl.conf" file with the code above inside directory
  3. Un-commented include line on httpd.conf ( Include "/etc/apache2/conf.d/...)
  4. Run /scripts/rebuildhttpdconf
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463