How do I disable htaccess for a specific domain in cpanel?

ish1301

Registered
Nov 28, 2011
1
0
51
Richmond Hill, Ontario, Canada
cPanel Access Level
Website Owner
I am looking for a way to add "AllowOverride None" only for a specific domain. I don't want to modify `/etc/httpd/conf/httpd.conf` for obvious reasons, as some domains need htaccess and some doesn't.

Is there a way to achieve this, without loosing configurations on every rebuild.
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
You could use /usr/local/apache/conf/includes/pre_main_global.conf and put the path to the user's home directory in it:

Code:
<Directory "/home/username">
    Options All
    AllowOverride None
</Directory>
Here I have Options All listed, but you would list whatever options you wanted for that specific user. Please replace username with the cPanel username for that account.

After adding this include, you would need to restart Apache.