Reputation: 358
I'm trying to host a php based application with the following .htaccess values.
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine On
RewriteBase /easydeposit
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
However, I keep facing the following two errors,
[access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/system/
[access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/private/
[access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/application/
[authz_core:error] [pid 25330:tid 27] AH01630: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/.htaccess
I'm not sure why this is happening. Any help is appreciated.
Upvotes: 21
Views: 79785
Reputation: 87
For me, there was an .htaccess file in the wp-config folder that had these entries
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js)$">
Allow from all
</Files>
That caused icons in the interface to show up as squares.
Upvotes: 0
Reputation: 6591
This question/answer got me to the documentation for which I'm thankful, and the following was what solved it for me.
Previous .htaccess
file:
# password protection allowing multiple resources
AuthType Basic
AuthName "Restricted Area"
AuthUserFile C:\path\to\.htpasswd
AuthGroupFile /dev/null
Require valid-user
# allow public access to the following resources
SetEnvIf Request_URI "(path/to/public_files/.*)$" allow
# these lines must be updated
Order allow,deny
# Allowing an ip range:
Allow from 69.69.69
# Allowing another range:
Allow from 71.71.71
Satisfy any
This configuration was producing errors like:
[Thu Dec 08 10:29:20.347782 2016] [access_compat:error] [pid 2244:tid 15876] [client 93.93.93.93:49340] AH01797: client denied by server configuration: C:/path/to/index.php
updated for 2.4 configuration
# 7 lines unchanged...shown again for clarification
AuthType Basic
AuthName "Restricted Area"
AuthUserFile C:\path\to\.htpasswd
AuthGroupFile /dev/null
Require valid-user
SetEnvIf Request_URI "(path/to/public_files/.*)$" allow
# these are the changes replacing:
# Order allow,deny
# Allow from <range>
# Satisfy any
Require ip 69.69.69
Require ip 71.71.71
Require all granted
Upvotes: 4
Reputation: 35
Another example, rewrite from:
www.yoursite.com/script.php?product=123
to
www.yoursite.com/cat/product/123/
using
RewriteRule cat/(.*)/(.*)/$ /script.php?$1=$2
http://w3webtutorial.blogspot.com/2013/11/htaccess-and-modrewrite-in-your-php.html
Upvotes: 0
Reputation: 775
If you have recently upgraded to a version of Apache greater than version 2.2, the authz_core error error might be coming from your httpd.conf or httpd-vhosts.conf file in the <Document>
tags. mod_authz_core was introduced in Apache 2.3 and changed the way that access control is declared.
So, for example, instead of the 2.2 way of configuring <Directory>
...
<Directory "C:/wamp">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Order and Allow directives have been replaced with the Require directive:
<Directory "C:/wamp">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Sources http://www.andrejfarkas.com/2012/06/fun-with-wamp-server-and-apache-2-4-2/ http://httpd.apache.org/docs/2.4/upgrading.html
Upvotes: 57
Reputation: 143936
I doubt this has anything to do with your htaccess file. The errors are thrown by mod_access_compat, which provides the Allow
, Deny
, Order
, and Satisfy
directives. Somewhere, you probably have your allow's and deny's configured wrong. As for the .htaccess error at the end, it's from mod_authz_core, so there may be something upstream that blocks access to .htaccess files outright.
Upvotes: 2
Reputation: 266
And you are absolutely sure that the apache user (probably _www) has access to the directory (/home/abc/opt/apache/htdocs/xyz/
)?
Upvotes: 0
Reputation: 1
Options +FollowSymLinks
Options -Indexes
on many shared hosting the above code often the main problems
Upvotes: 0
Reputation: 71
Are you sure that your are allowed to override Options in your .htaccess file? check main apache config file for this
Upvotes: 0