Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a problem on OpenSuSE 11.04. I configured apache and enabled mod_rewrite but it doesn't working. on every php file I get 403 forbidden error.

share|improve this question
add comment

1 Answer

Have you updated your /etc/apache2/httpd.conf file? If not, open it and add the following lines at the end of the file. You may need to replace /srv/www/htdocs with the path to your server's 'htdocs' or 'public_html' directory:

DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
    Options +FollowSymLinks
    AllowOverride all
    Order deny,allow
    Allow from all
</Directory>

Restart Apache and check your URL again. If you still see errors, try creating an .htaccess file in your htdocs folder to force the base directory. This seems to help sometimes if your hosting company puts their VPS boxes behind another server:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
</IfModule>

If this still fails to fix things for you, check the logs at /var/log/apache2/access_log and /var/log/apache2/error_log to see what's going wrong. You can also use RewriteLogLevel to get more information about where the URL rewrite fails.

share|improve this answer
    
Man i was since yesterday trying to understand why my mode-rewrite was not working... and i tried your solution to put this piece of code in my httpd.conf: DocumentRoot "/srv/www/htdocs" <Directory "/srv/www/htdocs"> Options +FollowSymLinks AllowOverride all Order deny,allow Allow from all </Directory> And my Codeigniter started to work like a charm... thanks for the tip!! –  user18316 Sep 10 '12 at 18:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.