Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess search optimization in cPanel & WHM version 66

Discussion in 'General Discussion' started by dcusimano, Aug 31, 2017.

  1. dcusimano

    dcusimano Member

    Joined:
    Feb 24, 2008
    Messages:
    11
    Likes Received:
    4
    Trophy Points:
    53
    Location:
    Toronto, Ontario, Canada
    When I logged into WHM 66.0.17, the feature showcase showed:

    .htaccess Optimization
    The .htaccess Optimization feature reduces the paths Apache will check for “.htaccess” files to the user’s home directory, which can significantly boost server performance.​

    The Release Notes for version 66 says:

    .htaccess search optimization
    In cPanel & WHM version 66, on new installations, we configure Apache to only search for .htaccess files in the /home/USERNAME/ directory and its subdirectories, where USERNAME represents the account's username. This decreases the number of locations to search for .htaccess files, which improves the speed of Apache searches. We display a feature showcase item to enable this feature for already-installed systems.​

    These descriptions appear to be inconsistent. The showcase says only the user's home directory is searched, yet the release notes say the home directory *and* its subdirectories. Which is it?

    Also, the release notes say "This decreases the number of locations to search..." So were there some directories outside of the user's home directory (and its subdirectories) that were searched before? If not, then how is there a decrease?

    Exactly what directories are searched with the feature enabled?
    Exactly what directories are searched with the featured disabled?
    How can this feature be enabled/disabled later (outside of the showcase)?

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,165
    Likes Received:
    1,371
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    For the recommended "Search "Home Directory" and below" option, the .htaccess files in your account's subdirectories are recursively searched in the /home/$username/ directory. EX:

    /home/$username/.htaccess > works
    /home/$username/public_html/.htaccess > works
    /home/$username/public_html/123/.htaccess > works
    /home/$username/public_html/123/456/.htaccess > works


    If you enable the "Use "Document Root" and below" option, the .htaccess files in your account's subdirectories are recursively searched in the /home/$username/public_html (or whatever is configured as the document root for the domain name) directory. EX:

    /home/$username/.htaccess > doesn't work
    /home/$username/public_html/.htaccess > works
    /home/$username/public_html/123/.htaccess > works
    /home/$username/public_html/123/456/.htaccess > works


    Both descriptions are correct, however we updated the release notes to further clarify that it includes the account's home directory and it's subdirectories.

    Yes, previously the default configuration was to search for .htaccess files outside of the account's home directory as well. EX:

    /.htaccess
    /home/.htaccess


    This feature is controlled with the "Optimize .htaccess (AllowOverride)" option in "WHM >> Apache Configuration >> Global Configuration".

    Let us know if you have any additional questions.

    Thank you.
     
Loading...

Share This Page