To get that relative path value on each page itself, you
could just remove C:\websites\HostDirectory\Site\ from the absolute
path, thus
<cfset relpath=ReplaceNoCase(ExpandPath(
"myPage1.cfm"),"C:\websites\HostDirectory\Site\","")>
However, if you want code for myPage1.cfm that will find the
relative path of any given arbitrary file, myPage2.cfm, then you
could implement a
search.
The reason is, such a file may have an arbitrary directory
structure,
C:\websites\HostDirectory\Site\..\dir1\dir2\..\myPage2.cfm. I also
wonder whether one could do it with code that searches using
cfdirectory. I'm looking into it.
... View more