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!

.htaccess search optimization in cPanel & WHM version 66

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

  1. dcusimano

    dcusimano Member

    Feb 24, 2008
    Likes Received:
    Trophy Points:
    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)?

  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    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:


    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice