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? Commented 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. Commented Feb 2, 2011 at 15:13
  • check if you have a rewrite.conf in /etc/apache2/mods-enabled Commented Feb 2, 2011 at 15:16
  • @Elzo: if it's cPanel / WH, mod_rewrite is almost certainly on. Commented Feb 2, 2011 at 15:17
  • @Elzo can i do that throught cpanel or WHM Commented 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
  • 1
    +1 for dark reference in the manual Commented Feb 2, 2011 at 15:28
  • Ben i think you might be interested in my new Question serverfault.com/questions/230262/… Commented Feb 2, 2011 at 17:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.