0

I am using cPanel and Apache, and I am seeing the following error in my error_log:

[Wed Feb 02 09:06:04 2011] [error] [client 110.34.4.242] client denied by server configuration: /home/websmart/public_html/.htaccess

My project is based on PHP 5.3 using the zend framework. My .htaccess file contains:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^.*$ index.php [NC,L]

Can anyone tell me what causes this error and how should I alter my .htaccess file to resolve this?

my webhost manager picture enter image description here

5
  • do you have mod_rewrite enabled? Feb 2, 2011 at 15:12
  • @Elzo Vaugi i dont know how to do this on server ... and also don't know how to check this on server.
    – S L
    Feb 2, 2011 at 15:13
  • check if you have a rewrite.conf in /etc/apache2/mods-enabled Feb 2, 2011 at 15:16
  • @Elzo: if it's cPanel / WH, mod_rewrite is almost certainly on.
    – Josh
    Feb 2, 2011 at 15:17
  • @Elzo can i do that throught cpanel or WHM
    – S L
    Feb 2, 2011 at 15:17

1 Answer 1

3

Check your options. You must have

Options +FollowSymLinks

to enable per-directory rewrite rules.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteRule

You may be able to put the "Options +FollowSymLinks" directive in the same .htaccess file, if your server-level config allows it. The server-level config must set the "AllowOverride" directive to "all" or it must contain "Options" or "Options=FollowSymLinks" to allow you to do this. See http://httpd.apache.org/docs/current/mod/core.html#allowoverride

So, at least try with this as your .htaccess file:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

If that doesn't work, you'll need to dig up your server config and modify the options there.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .