I have multiple web sites and have SSI all working fine! but I want a script that allows me to place a SSI script (or .html) on any web site within my server - One problem, SSI is limited to files located within the file structure - I want to access a file outside, (but still on my server) I found this.
-----------------------------------------------------------------
Including Files Outside Your Document Directory
For security reasons, many servers are configured not to allow you to copy in files located outside your webspace, or DocumentRoot. You can either copy the file to your document directory, or do this little trick:
The unix ln (link) command allows you to create a entry in a directory that points to a real file located elsewhere on the computer. If you have a file called myfile.txt located in /usr/me/mybookfiles/source you could do this:
cd public_html (or wherever your webpage is located)
ln -s /usr/me/mybookfiles/source/myfile.txt myfile.txt
You will now have a directory entry in the document directory and your include should work just fine!
------------------------------------------------------------------------
I think that's exactly what I want to do but am not sure how to write the script/syntax ------ I am used to writing in this format
<!--#include virtual="/somedir/file.txt" -->
BUT since this is a unix script there doesn't look like there are any brackets <> so maybe I don't need no brackets for unix (yes newbie here
--- if I don't need brackets then this would be where the file is located:
cd public_html/thefileIwant.html (do I place this in the head or body or .... of my html page?)
ln -s /usr/me/mybookfiles/source/myfile.txt myfile.txt
means what? how do I interpret this line.........
In (is the command that tells unix to let me in)
-s /usr/me/mybookfiles/source/therfileIwant.html (if the first line points to the file that I want - then what does this script do and what do I write?)
-
do I need to alter the .htaccess file? or it has nothing to do with it because it's a unix command and not SSI
so I need help to write these 2 lines because I want to call in a file to appear on any of my domains within my server.
Thanks
John
---------- Post updated at 05:51 PM ---------- Previous update was at 03:22 PM ----------
Well, I can't complain about 52 people having a look, but no response? maybe I need to make it clearer.
I think I have found the script to make me happy, just don't know what to do to implement.
I need to customize this:
cd public_html (or wherever your webpage is located)
ln -s /usr/me/mybookfiles/source/myfile.txt myfile.txt
my guess for the first line:
cd public_html/myfile.html
I don't have a guess for the second line:
ln -s /usr/me/mybookfiles/source/myfile.txt myfile.txt
The file I have sits inside my public_html folder and works with the root domain - I am using SSI and it all works fine! BUT now I just want to be able to call this file to other web sites on the same server, (and SSI cannot do this since it calls a file from within the folder structure not outside) and I want to use a common menu, which is found outside the domain folders and in the root for example, public_html/myfile.html.
Looking forward to getting some help.
Thanks.