I have two domains hosted separately on a Happy Hosting shared host. A lot of content on both domains is the same, so I want to have a shared folder in my account that both sites can access. For some reason, though, I am not able to do that.
My hosting account has 3 relevant directories: /home/username/website1; /home/username/website2; and /home/username/shared
When users to go www.website1.com, they are directed to /home/username/website1/index.htm. Within that page, I have a reference to a script at /home/username/shared/script.js. How do I direct the index.htm page to call the script.js script? On a normal setup, you would use <script src="…/shared/script.js">, but that isn’t working.
Checking the error logs, it says “File does not exist: /home/username/website1/shared” So even though I referred to one directory level higher than website1 (with the …/ portion of the src tag), the server is treating it as though I’m looking for a folder within the /website1 directory.
Dreamhost support says I should be able to access any file in my username’s directory and suggested that I use the absolute path to the file, but no matter how I try to address it, it doesn’t work. The error logs consistently show that I’m trying to access a subdirectory to /website1, even though I’m trying to refer to a separate directory on the same level as /website1. It really seems like it’s straight-up refusing to access anything outside of the /website1 directory.
Any ideas on how to accomplish this?