Skip to main content

.htaccess Optimization and Optimize Website

Comments

4 comments

  • cPanelMichael
    Hello, That's correct, if you set "Optimize .htaccess (AllowOverride)" to "Search Document Root and Below" in "WHM >> Apache Configuration >> Global Configuration", then the entries added to the "/home/$user/.htaccess" file when enabling the "Optimize Website" feature in cPanel are not detected. It also will prevent PHP inheritance from working, leading to potential issues with MultiPHP functionality. Setting the option to "Search Document Root and Below" is not recommended. That said, if you decided to configure the option to "Search Document Root and Below", then yes, enabling the mod_deflate entries directly in the virtual host is a suitable workaround: if you'd like to see the default behavior switched from the .htaccess inclusion to a virtual host inclusion when using the "Optimize Website" option. Thank you.
    0
  • sparek-3
    Well, the rant about Would a better solution be to avoid .htaccess files completely was actually about doing away with the .htaccess behavior altogether - a la nginx. But yea, the Optimize Website probably needs to be moved into the user's Apache userdata directory structure.
    0
  • cinthisone
    Hello, That's correct, if you set "Optimize .htaccess (AllowOverride)" to "Search Document Root and Below" in "WHM >> Apache Configuration >> Global Configuration", then the entries added to the "/home/$user/.htaccess" file when enabling the "Optimize Website" feature in cPanel are not detected. It also will prevent PHP inheritance from working, leading to potential issues with MultiPHP functionality. Setting the option to "Search Document Root and Below" is not recommended. That said, if you decided to configure the option to "Search Document Root and Below", then yes, enabling the mod_deflate entries directly in the virtual host is a suitable workaround: if you'd like to see the default behavior switched from the .htaccess inclusion to a virtual host inclusion when using the "Optimize Website" option. Thank you.

    Thank you for pointing out where this setting was! When I updated my server, all my Wordpress sites using temporary URLs had broken permalinks. I always use temporary URLs on my development sites. Does anyone know how to get tempoary URLs working with Wordpress pretty permalinks with this enabled? I would love to enable it for performance.
    0
  • cPanelMichael
    Does anyone know how to get tempoary URLs working with Wordpress pretty permalinks with this enabled? I would love to enable it for performance.

    Please see the following thread: mod_userdir broken since cPanel 66 Thank you.
    0

Please sign in to leave a comment.