I'm looking at the documentation, and have questions:
documentation.cpanel.net
I have an extensive .htaccess file on one of my sites, and I'd like to move it here to improve load time and for security.
My first question is about SSL. In my .htaccess, I redirect non-SSL users to the SSL page. But since this has a different file for SSL vs non-SSL, does that mean that I STILL have to have an htaccess file for this?
Second question is about the Apache version. It wants you to explicitly define /2_4/, but what happens when there's an update to 2.5? Does the directory change automagically?
Third question is about compression. My regular htaccess is at /home/account/www/, but when I use "Optimize Website" in cPanel it puts the info in the htaccess at /home/account/. Can I combine them in the include file?
Similarly, can I just copy this information to /etc/apache2/conf.d/userdata/includename.conf and let it apply to ALL of my websites? I understand that I have to create the literal /userdata/ directory manually, but what should "includename" actually be?
Fourth question is about the htaccess data itself. Is this a direct copy-and-paste, or do I need to modify RewriteConds and RewriteRules?
The docs say to use /etc/apache2/conf.d/userdata/ssl/2_4/user/includename.conf, where /user/ would be the actual user's name and not the literal word "user". But what should "includename" actually be?
Fifth question... WHM plugs in 6 lines of RewriteCond for EVERY rule that I have, effectively making the file size much larger than it needs to be. Will they still be plugged in to the include file, or can I modify it with this line at the top and not worry about cPanel modifying it?
And final question, once I have everything set up for my site, how do I turn off .htaccess for that one site entirely so that Apache doesn't waste time looking for it?
Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation
I have an extensive .htaccess file on one of my sites, and I'd like to move it here to improve load time and for security.
My first question is about SSL. In my .htaccess, I redirect non-SSL users to the SSL page. But since this has a different file for SSL vs non-SSL, does that mean that I STILL have to have an htaccess file for this?
Second question is about the Apache version. It wants you to explicitly define /2_4/, but what happens when there's an update to 2.5? Does the directory change automagically?
Third question is about compression. My regular htaccess is at /home/account/www/, but when I use "Optimize Website" in cPanel it puts the info in the htaccess at /home/account/. Can I combine them in the include file?
Similarly, can I just copy this information to /etc/apache2/conf.d/userdata/includename.conf and let it apply to ALL of my websites? I understand that I have to create the literal /userdata/ directory manually, but what should "includename" actually be?
Fourth question is about the htaccess data itself. Is this a direct copy-and-paste, or do I need to modify RewriteConds and RewriteRules?
The docs say to use /etc/apache2/conf.d/userdata/ssl/2_4/user/includename.conf, where /user/ would be the actual user's name and not the literal word "user". But what should "includename" actually be?
Fifth question... WHM plugs in 6 lines of RewriteCond for EVERY rule that I have, effectively making the file size much larger than it needs to be. Will they still be plugged in to the include file, or can I modify it with this line at the top and not worry about cPanel modifying it?
Code:
RewriteRule ^(\d+\..+\.cpaneldcv|[A-F\d]{32}\.txt(?:\ Comodo\ DCV)?|\.well-known/(pki-validation/([A-F\d]{32}\.txt(?:\ Comodo\ DCV)?|(?:\ Ballot169)?)|acme-challenge/[\w-]+|cpanel-dcv/[\w-]+)) - [L]