We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

403 Forbidden - Permission Error

Hello,

I've got following problem:

You don't have permission to access / on this server.

Apache/2.2.15 (Oracle) Server at xxx.xxx.xxx.xxx Port 80

I've tried: chmod xxx /var/www/site where xxx is on of these permissions: 777, 755, 655 However it didn't help. I've set user/group for that folder root:root. Similar configuration i've got for other virtual host and that works there but not for phalcon project. I can access to files that are direcrly in that folder, for example /info.php and got php configuration information.

My .htaccess in /var/www/site is:

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteRule  ^$ public/    [L]
RewriteRule  (.*) public/$1 [L]

</IfModule>

Try throwing an index.html file in there & see what happens then. The 403 error might not be due to file permissions, but due to the fact that Apache might be configured to not allow directory listings. If that's the case, then maybe your .htaccess file isn't working.

edited Sep '15

When I'm throwing index.html I've got:

Mod-Rewrite is not enabled Please enable rewrite module on your web server to continue

but when I create test.php file with:

print_r(apache_get_modules());

I've got there mod_rewrite

//EDIT

When I've added:

<Directory /var/www/html/xxx>

Options All AllowOverride None Order allow,deny Allow from all </Directory>

to virtua host config I got list of all files, not site



125.8k
Accepted
answer

It may be possible that mod_rewrite is not enabled on a per-directory basis. Basically that means you can put mod_rewrite directives in the base apache config files, but not in .htaccess.