bt4

Well-Known Member
Jul 1, 2010
69
0
56
Hi,

i want disable .htaccess for all hosts,
if some upload or make new file name by .htaccess Automaticaly deleted or hided and get error 500 to this host
i dont want it work on my server
 

bt4

Well-Known Member
Jul 1, 2010
69
0
56
i dont want find htaccess from websites, if i delete them , hosts can make new one again, i want disable .htaccess
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

You should have a section similar to the following:

Code:
<Directory "/">
Options All
AllowOverride All
</Directory>
Whatever it has listed for AllowOverride line, change to:

Code:
AllowOverride None
At that point, then distill the changes, rebuild Apache and restart Apache:

Code:
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110802
/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
No further .htaccess files should work after this is set. It basically stops overrides at / level and higher using .htaccess files.
 

bt4

Well-Known Member
Jul 1, 2010
69
0
56
thanks

but how i can active htaccess just for one host or tow?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
You cannot. It is one or the other.

Also, your original request did not include this:

i want disable .htaccess for all hosts,
...
i dont want it work on my server
It is probably possible to give another <Directory "/pathtodirectory"> option to allow AllowOverride, but I didn't test that option, since it wasn't what was asked.

Edit: So, upon testing, this works:

Code:
<Directory "/">
    Options All
    AllowOverride None
</Directory>

<Directory "/home/username">
    Options All
    AllowOverride All
</Directory>
This would again need to be distilled, Apache rebuilt and Apache restarted. The username in the path would need to be revised to the actual cPanel username. At that point, the account in question can have an .htaccess file working.
 

bt4

Well-Known Member
Jul 1, 2010
69
0
56
i test it, and working, before test it i have some problem, .htaccess showed from some host, and hided from some hosts some
from some hosts when i make htaccess it get hided Automatically
but from some host showed but ddt work
what is the problem of that?
from my friend server when some one upload .htaccess this Host Automaticaly get Error 500
how he do that?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Unfortunately, I am unclear on what is being asked this time. Please try to be clear with proper grammatical sentences on what is needed or being requested.

The above method should be working for what was asked already. If this is not sufficient for reaching the goal required, when it does actually work to provide no .htaccess allowed for most accounts and allow some to use one, then I cannot really say why anything else is needed at this point.
 

shahjashua0

Registered
Aug 4, 2011
4
0
51
u can try this code to avoid such a problem

cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110802
/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
I had already provided those same commands earlier when noting how to distill changes upon revising the AllowOverride section of httpd.conf file. I'm not certain if that was what was being asked by bt4