I've created a symlink shown here;

lrwxrwxrwx   1 apache apache   33 Nov  4 11:55 blog -> /var/www/blog.mysite.com

Which resides in the base of this directory


If I attempt to browse to www.mysite.com/blog I get a 403 permission denied response. However if I navigate to www.mysite.com/blog/ (with a trailing slash) Everything works as expected.

I've attempted to insert .htaccess rules in both root folders of these to force the trailing slash (RewriteRule ^[^/]$ /blog/ [L,R=301]), but it appears that a request without the slash does not hit either .htaccess file as intentional errors in either or both of these files, does not affect the 403 response. I'd maybe expect a 500 error when intentionally writing errors here.

All parent folders of these directories have 755 permissions and are owned by root. I tried changing the parent folder owner:group to apache too, but didn't notice and differences.

All other questions I've found on this topic seem to suggest checking the permissions for parent folders, but none of the questions I've found have stated that the smylink actually works with a trailing slash on the folder name.

I've got Options +ExecCGI +FollowSymlinks -SymLinksIfOwnerMatch set in my /etc/httpd/conf/httpd.conf file. The server runs on CentOS.

  • duplicate of stackoverflow.com/questions/2006186/trailing-slashes-problem "Trailing slashes problem" ? – steve Nov 4 '16 at 14:26
  • @steve That's unrelated. Under usual circumstances, my server has no issue routing a /directory to /directory/index.php. This issue is specific to using a symlink. If I manually place an index file in the main domain under /blog and remove the smylink, the url with out the trailing slash will work. – Novocaine Nov 4 '16 at 15:27
  • 1
    Is Options FollowSymlinks set? – DopeGhoti Nov 4 '16 at 15:39
  • I've got Options +ExecCGI +FollowSymlinks -SymLinksIfOwnerMatch set in my /etc/httpd/conf/httpd.conf file – Novocaine Nov 4 '16 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.