Access files above the document root

Avatar
  • Answered
I am using an addon domain (addon.com) while the primary domain is (primary.com)
I need to access images, files etc under public_html and under public_html/image from files under the addon domain. When I do ../ in files in the addon domain files, it does not go one folder up to public_html but gets to the document root of addon.com. Interestingly, include statements like ../ successfully include public_html files.

This problem happens when i go to www.addon.com
This problem does not happen when I go to primary.com/addon.com

I read that this could be handled using Virtualhost, FollowSymLinks, mod_rewrite etc. I got some information from http://httpd.apache.org/docs/2.2/urlmapping.html#outside but I need help on how this can be done. Any help will be much appreciated.
Avatar
Arn
Hello Henry_ford, Sorry for the problems with the path. The issue has to do with the document root of the domain. You can change it in the cPanel under add-on domains. You may also try a re-write but you're basically creating a re-direct in trying to redirect the contents of a whole directory to the webserving root. Check out this article for examples. I hope this helps to answer your question, please let us know if you require any further assistance. Regards, Arnel C.