I am on a shared hosting package on a LAMP stack with no shell access.
I can create symlinks using PHP’s
Let’s say my web root is
Let’s say I have a real directory named
And I create a symlink named
/home/www/user1/public/fake_dir pointing to
Why would I get a 403 Forbidden when trying to access
www.mydomain.com/fake_dir but not when trying to access
It shouldn’t be a rights problem because when I create a file in PHP, I can access that all right.
I tried switching
FollowSymlinks off and on in .htaccess (it was on), but no luck.
Could it be that
FollowSymlinks is defined as not overwritable in a .htaccess file? Or is there something else to be aware of when working with Symlinks in Apache?
Apache has to be configured to allow access to the directory on the filesystem. This has to be done by a system administrator by inserting a <Directory> directive in the apache configuration files (httpd.conf).
Since the real directory is inside the web root it must be accessible, but FollowSymLinks may not have been enabled for the directory – this also has to be added to the <Directory> directive.
This is possible SELinux security issue.
if the value is 1, set it to 0, then restart apache.