On-Rev file path

Mike Bonner bonnmike at gmail.com
Wed Mar 23 05:09:40 EDT 2011


as jim said, anything in public_html and down is accessible from your
browser, with public_html being the root. So say you had a file fred.html
there, it would be http://yourdomain.wheveritsat.com/fred.html  In the case
of on-rev, your addon domains are mapped to a folder when you set them up so
their root may not be in public_html specifically, they could be
public_html/otherdomainname, but this too is handled by the server so still.
If you have a domain setup called otherdomain.com that is mapped to the
folder /home/jayb/public_html/otherdomainname.com/  And you had your
fred.html file in there, you still don't need to use the full path, and in
fact it wouldn't work.  it would still be
http://otherdomain.com/fred.htmlbecause the server knows the root for
that domain.

The reason to use an outside location for a file would be specifically so
that people can't just point a browser at it and access the file, which as
jim said is not allowed by the browser.  You can however, put libraries
there and include them.  So, if you had a library for connecting to a
database, and it contained information regarding your setup that you didn't
want people to poke around in, you could create it above public_html and
'include' it from another page within your regular pages. So if you had an
irev file dbdisplay.irev that returns data from your database and a folder
named indrectlyaccessiblelibraries folder located in /home/jayb then if you
have a line like the following in dbdisplay.irev:

include "/home/jayb/indirectlyaccessiblelibraries/mydblibrary.irev"

any functions and commands that are in your library would be available to be
used in dbdisplay.irev. Or more simply, it could just be a file that
displays content itself but that you don't want snooped, so same deal, just
include it,and whatever output it has will appear wherever you 'include' it
in the main file.

If you are using an .irev as a library for commands and functions, it will
need to be included at the top of the main file since things are loaded
linearly.  If you put your include at the bottom, and its used to something
that appears earlier in the file it will fail because the functions and
commands that it provides won't be loaded yet.

As an aside, any subfolders within the main folder for a domain DO need to
be specified directly, so if you have your domain mydomain.com whose root is
in /home/jayb/public_html/mydomain.com, and you have a folder in there named
subfolder then to access pages from within that folder would be
http://mydomain.com/subfolder/mypage.irev



More information about the use-livecode mailing list