Manually enabling .htaccess on LiteSpeed Enterprise

#1
*** NOOB WARNING ***

I'm thinking to disable .htaccess on my LiteSpeed server as I keep hearing .htaccess slows down your web-server since it has to look into every directory. So I had three questions that I thought I should explore:
  1. Am I even wasting my time? If load time impact is only 20-30ms, I guess I wouldn't mind. But if it's 50ms, I would.
  2. Is there an easy way to disable .htaccess rewrites overall and then I just copy existing .htaccess from my 4 WordPress sites to--I'm guessing--the main httpd.conf?
  3. Or how about if I disable .htaccess for ALL directories, but manually allow it for the root directories of my 4 WP sites?
  4. ....any other thoughts?
 

Usman Nasir

Member
Staff member
#2
If you have root access (access to your main configuration file, assuming you are using WHM). Than you can disable .htaccess, because you can have your rewrite rules directly in main conf.
 
#3
Yes, I'm on WHM/cPanel and have root access. Disabling .htaccess is done from LS admin, right? And then for the htaccess rewrite rules, can I just copy them all from the each htaccess file directly into the main conf or do I need to edit or alter them to specific which sites, etc? This is only done from command line...or can I do it from WHM or even FTP?
 

Usman Nasir

Member
Staff member
#4
Yes, I'm on WHM/cPanel and have root access. Disabling .htaccess is done from LS admin, right? And then for the htaccess rewrite rules, can I just copy them all from the each htaccess file directly into the main conf or do I need to edit or alter them to specific which sites, etc? This is only done from command line...or can I do it from WHM or even FTP?
WHM Auto generate configuration files, so for each virtualhost you have following file to add your changes:
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/<username>/<domain>/*.conf"
There you can directly add rewrite rules to the file, you have to do that for each virtualhost seprately.
And to disable htaccess you have to manually change httpd.conf

You can than instruct litespeed to ignore .htaccess from
Configuration > Server > General > HT Access
and make sure only "None" is checked.
 
Last edited:

Michael A

Administrator
Staff member
#5
Hello Johnny,

LiteSpeed Web Server generally does not have to check every directory for .htaccess like Apache does as we use a form of .htaccess caching to avoid this performance hit, so there should be no reason to disable/avoid .htaccess when on LiteSpeed.

Regards,
-Michael
 
Top