Skip to main content

Comments

3 comments

  • cPanelChris
    Hello @GoWilkes , [QUOTE]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?
    You should be able to place the redirect in the non-SSL include. So a .htaccess file should not be required for this. [QUOTE]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?
    I would not expect the directory to be updated automagically. I would recommend double-checking this if Apache is updated to 2.5. [QUOTE]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?
    mod_deflate directives can be used in the include file. Adding the mod_deflate directives in /etc/apache2/conf.d/userdata/ssl/2_4/user/includename.conf would be equivilent to adding them in /home/account/.htaccess. Adding them to /etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf would be equivilent to adding them to /home/account/www/.htaccess. [QUOTE]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?
    Correct. The include files in /etc/apache2/conf.d/userdata/ will apply to all sites, with and without SSL. includename can be anything you want. The only requirement is that the file name must end with ".conf". This is because the wildcard include statements specify "*.conf" files to be included. For example: Include "/etc/apache2/conf.d/userdata/std/2_4/user/domain.tld/*.conf"
    [QUOTE]Fourth question is about the htaccess data itself. Is this a direct copy-and-paste, or do I need to modify RewriteConds and RewriteRules?
    You should be able to copy them from the .htaccess file into the include file. [QUOTE]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?
    Again, includename can be anything, so long as the file name ends with ".conf". [QUOTE]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?
    I don't believe cPanel will modify the include files. [QUOTE]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?
    Per the Apache
    0
  • GoWilkes
    Awesome information, thanks! One last question, then, until I try it and mess something up... Is there a speed advantage to having a single .conf as opposed to multiple? Meaning, could I have: /etc/apache2/conf.d/userdata/ssl/2_4/user/rule_1.conf /etc/apache2/conf.d/userdata/ssl/2_4/user/rule_2.conf /etc/apache2/conf.d/userdata/ssl/2_4/user/rule_3.conf and so on, making it easier to maintain and update as needed? Or should I really only have a single .conf with all of the rules, like I have with .htaccess?
    0
  • cPanelChris
    Hello @GoWilkes , I believe the include files would only be read when the Apache configuration being parsed, as in when Apache is being started or it receives a SIGHUP signal. So I would not expect there to be a performance hit when loading a site due to this.
    0

Please sign in to leave a comment.