How Do I Get to Root w/Applilcation CFINCLUDE?

I have a check in my application.cfm that does a CFINCLUDE if
the user isn't logged in, problem is, if they're a few levels deep
in the site it doesn' t pull my css or images. My question is, how
can I check to see if the page is at the root of the site, and if
not, move it here so it will pull all images and css from my root
instead of pulling it from \orientation\user
I want to pull from
does that make sense to you? basically, I want to force the
page to my root directory from anywhere on the site.

The URLs of the images and CSS files should not be relative
to the location
of the file you're including because the locations of each
have nothing to
do with one other: the file being included is done so by the
CF Server; the
images and CSS files are being fetched by the webserver.
The URLs to any resource being fetched by the webserver
should be either
relative to the current URL (as seen in the address bar); or
absolute from
the webroot dir (which is easier).
Given this web dir:
C:\inetpub\wwwroot\siteroot\ <=
http://www.you.com mapped to here
C:\inetpub\wwwroot\siteroot\css\mystyles.css
C:\inetpub\wwwroot\siteroot\pics\me.png
C:\inetpub\wwwroot\siteroot\includes\myinclude.cfm <--
contains <img> and
<link> tags to above files
C:\inetpub\wwwroot\siteroot\mysubdir\index.cfm <--
includes myinclude.cfm
C:\inetpub\wwwroot\siteroot\mysubdir\deeper\down\index.cfm
<-- includes
myinclude.cfm
Example request 1:
URL of request:
http://www.you.com/mysubdir/index.cfm
Relative URL of CSS: ../css/mystyles.css
Relative URL of image: ../pics/me.png
Absolute URL of CSS: /css/mystyles.css
Absolute URL of image: /pics/me.png
Example request 2:
URL of request:
http://www.you.com/mysubdir/deeper/down/index.cfm
Relative URL of CSS: ../../../css/mystyles.css
Relative URL of image: ../../../pics/me.png
(you can see these relative URLs have no bearing on the
location of the
include file)
Absolute URL of CSS: /css/mystyles.css
Absolute URL of image: /pics/me.png
(you'll note these absolute ones are the same as above: they
don't change.
Hence the whole "absolute" thing)
Adam

Similar Messages

  • How do I get superuser/root rights in Mac OS X?

    I just bought MacBook Pro and was wandering how could I get access to superuser/root rights. I type su in the terminal like you would do in Linux, but it asks me for the password, which I am sure I did not set during the installation. How to get past it?

    Hi omonrah,
    first of all: WELCOME TO THE DISCUSSIONS!
    You are right: typing "su" will give you permanent root privilegies while typing "sudo" will grant you these privileges only for the next command.
    In order to use the root-user you have to activate it first. By default the root user is deactivated in MacOS X. Read this article for instructions how to activate the root user: Enabling and using the "root" user in Mac OS X

  • How do you get the root folder to recognize updated file in nested folder?

    I believe in OS 9, a modified file nested in a folder would trigger the root folder to recognize and update to the top of the "date modified" column. As long as I've used the Mac (20 years) I've used the "date modified" to force my current client folders to the top of the column. Lately, I have many nested folders in the root client folder. When I make changes to a file in a nested folder, OS X doesn't make the root folder recognize changes within a nested folder. I realize there is not likely to be a fix for this in OS X, as Apple probably deems this behavior to be proper (I do not,) so my question would be expanded to include suggestions for third party software that may accomplish this.

    Sorry, posted that last post and ran out of time while editing it. It should read like this:
    "Yes, if you ADD a new item or folder to a folder, it updates the root folder, but if you simply MODIFY a file (like Photoshop) within a subfolder, the root folder WILL NOT update the date modified. Check it out."
    Actually, whether the directory that a file is re-saved in will be modified or not can depend on the application in question and how it saves files.
    Let's say a folder has a single file in it. The modification date of the folder will be the last time a change was made to the directory, either by adding or removing an item from it. (This can include the invisible .DS_Store file in which the Finder saves view settings for a folder, which can often be written without you're realizing it unless you have the Finder show all files like I do).
    Then, let's say you open that file, which is a stream of bytes, in an application. You make some changes which alters the representation of the stream of bytes in RAM. The application then saves the changes to the file by filling it with the stream bytes as they now are in RAM. Modifying the contents of a file in this manner does not alter the directory that it's in. The modified date of the folder should remain unchanged.
    Some applications use a different method than above to save files, however. Let's say that theoretically while the application is re-writing to the original file during a save, the power goes out and your computer shuts down. There's a good chance that the document that was being saved is now corrupt. A safer method that some applications use, is to first write out the information to a new file in the same directory as the original file, then delete the original file, and then rename the new file so that it has the same attributes as the old file. This method will, of course, modify the directory that the original file was in by adding and removing a file.
    Dual 2.7GHz PowerPC G5 w/ 2.5 GB RAM; 17" MacBook Pro w/ 2 GB RAM -   Mac OS X (10.4.8)  

  • How can I get arch-chroot to source /root/.profile [solved]

    I really like the arch-chroot script. When I come into the chroot using the script, I see that the shell is /bin/sh instead of bash. That is ok. How can I get the root user inside the chroot to source /root/.profile automatically? I have a line in there that will
    exec /usr/bin/bash
    . Thank you.
    Last edited by maggie (2013-09-16 19:27:20)

    2ManyDogs wrote:
    Beginner's Guide wrote:
    Note: Use
    arch-chroot /mnt /bin/bash
    to chroot into a bash shell.
    That works. Thank you.

  • How can i get also the files in the root directory and how can i for testing add items of IEnumerable FTPListDetail to List string ?

    What i get is only the directories and files that in other nodes. But i have also files on the root directory and i never
    get them. This is a screenshot of my program after i got the content of my ftp. I'm using treeView to display my ftp content:
    You can see two directories from the root but no files on the root it self. And in my ftp server host i have files in the root direcory.
    This is the method i'm using to get the directory listing:
    public IEnumerable<FTPListDetail> GetDirectoryListing(string rootUri)
    var CurrentRemoteDirectory = rootUri;
    var result = new StringBuilder();
    var request = GetWebRequest(WebRequestMethods.Ftp.ListDirectoryDetails, CurrentRemoteDirectory);
    using (var response = request.GetResponse())
    using (var reader = new StreamReader(response.GetResponseStream()))
    string line = reader.ReadLine();
    while (line != null)
    result.Append(line);
    result.Append("\n");
    line = reader.ReadLine();
    if (string.IsNullOrEmpty(result.ToString()))
    return new List<FTPListDetail>();
    result.Remove(result.ToString().LastIndexOf("\n"), 1);
    var results = result.ToString().Split('\n');
    string regex =
    @"^" + //# Start of line
    @"(?<dir>[\-ld])" + //# File size
    @"(?<permission>[\-rwx]{9})" + //# Whitespace \n
    @"\s+" + //# Whitespace \n
    @"(?<filecode>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<owner>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<group>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<size>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<month>\w{3})" + //# Month (3 letters) \n
    @"\s+" + //# Whitespace \n
    @"(?<day>\d{1,2})" + //# Day (1 or 2 digits) \n
    @"\s+" + //# Whitespace \n
    @"(?<timeyear>[\d:]{4,5})" + //# Time or year \n
    @"\s+" + //# Whitespace \n
    @"(?<filename>(.*))" + //# Filename \n
    @"$"; //# End of line
    var myresult = new List<FTPListDetail>();
    foreach (var parsed in results)
    var split = new Regex(regex)
    .Match(parsed);
    var dir = split.Groups["dir"].ToString();
    var permission = split.Groups["permission"].ToString();
    var filecode = split.Groups["filecode"].ToString();
    var owner = split.Groups["owner"].ToString();
    var group = split.Groups["group"].ToString();
    var filename = split.Groups["filename"].ToString();
    var size = split.Groups["size"].Length;
    myresult.Add(new FTPListDetail()
    Dir = dir,
    Filecode = filecode,
    Group = group,
    FullPath = CurrentRemoteDirectory + "/" + filename,
    Name = filename,
    Owner = owner,
    Permission = permission,
    return myresult;
    And then this method to loop over and listing :
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file" ;
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    Then updating the treeView:
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And inside a backgroundworker do work how i'm using it:
    var root = Convert.ToString(e.Argument);
    var dirNode = CreateDirectoryNode(root, "root", 1);
    e.Result = dirNode;
    And last the FTPListDetail class:
    public class FTPListDetail
    public bool IsDirectory
    get
    return !string.IsNullOrWhiteSpace(Dir) && Dir.ToLower().Equals("d");
    internal string Dir { get; set; }
    public string Permission { get; set; }
    public string Filecode { get; set; }
    public string Owner { get; set; }
    public string Group { get; set; }
    public string Name { get; set; }
    public string FullPath { get; set; }
    Now the main problem is that when i list the files and directories and display them in the treeView it dosen't get/display
    the files in the root directory. Only in the sub nodes.
    I will see the files inside hello and stats but i need also to see the files in the root directory.
    1. How can i get and list/display the files of the root directory ?
    2. For the test i tried to add to a List<string> the items in var files to see if i get the root files at all.
       This is what i tried in the CreateDirectoryNode before it i added:
    private List<string> testfiles = new List<string>();
    Then after var files i did:
    testfiles.Add(files.ToList()
    But this is wrong. I just wanted to see in testfiles what items i'm getting in var files in the end of the process.
    Both var files and directoryListing are IEnumerable<FTPListDetail> type.
    The most important is to make the number 1 i mentioned and then to do number 2.

    Risa no.
    What i mean is this. This is a screenshot of my ftp server at my host(ipage.com).
    Now this is a screenshot of my program and you can see that in my program i have only the directories hello stats test but i don't have the files in the root: htaccess.config swp txt 1.txt 2.png....all this files i don't have it on my treeView.
    What i want it to be is that on my program on the treeView i will also display the files like in my ftp server.
    I see in my program only the directories and the files in the directories but i don't see the files on the root directory/node.
    I need it to be like in my ftp server i need to see in my program the htaccess 1.txt 2.png and so on.
    So what i wrote in my main question is that in the var files i see this files of the root directory i just don't know to add and display them in my treeView(my treeView is treeViewMS1).
    I know i checked in my program in the method CreateDirectoryNode i see in the first iteration of the recursive that var files contain this root files i just dont know how to add and display them in my treeView.
    On the next iterations when it does the recursive it's adding the directories hello stats test and the files in this directories but i need it to first add the root files.

  • How do I get iWeb to publish just the files to my root directory

    Hey all, when I publish my site to my hosting server via iWeb it's just copying the entire folder into my root directory instead of copying the files to the root directory. This is causing my site url to look like this: www.mysite.com/myfolder/ how do I get iWeb to publich the files in the "myfolder" to my server instead of the entire folder?

    I needed to do this while keeping ftp publishing inside iWeb, and so I developed a sneaky solution. I just figured this out, so there may be some extra steps in here. Here goes:
    Find the iWeb application on the computer you are publishing from.
    Control-Click on the application and choose "Show Package Contents".
    In the window that appears, open the folder "Contents".
    Control-Click on the folder "Resources" and choose "Get Info".
    In the window that appears, open the "Sharing and Permissions" drop-down.
    Click the lock in the lower-right corner and enter your password.
    Where it says "Read Only" across from "Everyone", click the arrows and choose "Read and Write".
    Close the "Info" window and open the "Resources" folder.
    Find the "defaultPublishConfiguration.plist" file and change the permissions (repeat steps 4-7 but with "defaultPublishConfiguration.plist" instead of the "Resources" folder).
    Open the "defaultPublishConfiguration.plist" file in TextEdit.
    Find the line "<string>/Web/Sites</string>".
    Change it to "<string>/Web</string>".
    Save and close the text file.
    Restart iWeb.
    Go to your publishing settings and enter the information for your server. Point the "Directory/Path" to the folder above your server's root web folder.
    Set "Site Name" to the name of your server's web folder.
    Make sure that none of the files in your server's web folder have the same name as those iWeb would upload.
    Select File>Publish Entire Site.
    It should now publish your site to "http://www.yourdomain.org/Home.html".
    Hope it works!
    mindoftea

  • TS1543 my mac wont stop at single user it continues to root, how can i get to single user to enter info needed to reset password

    I my mac wont recognise my password, i have tried to reset password using single user but my mac wont stop at single user it just continues to root, how do i get it to stop at single user so i can add info needed to reset password?

    Are your sure that wasn't a Verbose boot (Cmd-V) you were trying? That would go on to a regular boot.
    Try a PRAM Reset, then try the single user, Cmd-S, at the startup chime. For the PRAM Reset, hold down Option - Cmd - P - R all together until it chimes a total of three times, then let go to finish booting.

  • How to get the root view of a UIView?

    How to get the root view of a UIView?

    Hi, loop through the superview property until it's nil. I suggest implenting it as a category:
    @implementation UIView (whatever)
    - (UIView *)rootView;
    @end
    - (UIView *)rootView
    UIView *rootView = self;
    while (rootView.superview) rootView = rootView.superview;
    return rootView;
    Warning: typed from memory, so not guaranteed to be errorfree.

  • How to get the root class in call heirarchy

    Hi,
    Is anybody have some idea regarding the getting name of a class whose, main method was called at the time of begining. In other words if we say, how can we get the invoker class of a java program with multiple level of inheritence.
    Regards

    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
         DocumentBuilder db=factory.newDocumentBuilder();
         Document doc=db.parse(new File(ur xml file"));
         Element root=doc.getDocumentElement();
         System.out.println("root "+root.getNodeName());

  • How to get the root node of a tree?

    I wanna get all the leaf node of a tree.But JTree have no method about how to get the root TreeNode of a tree.Then how should I do?

    try this:
    http://javaalmanac.com/egs/javax.swing.tree/GetNodes.html?l=rel

  • Apple tv 2 - root password has been changed to non default.   I need to access apple tv 2.   how do i get access with a forgotten password

    apple tv 2 - root password has been changed to non default.   I need to access apple tv 2.   how do i get access with a forgotten password

    Welcome to the Apple Community.
    It depends on which password you are referring to, but generally speaking you can always restore the Apple TV.

  • How can I get the web application's context root?

    I have a web application, which is defined in Tomcat's server.xml:
    <Context path="/cbes" docBase="e:\work\GM\code\CBESCurrency" debug="0"
    reloadable="true" crossContext="false"/>
    And I hava a servlet in this web application.
    How can I get the context root of the web application?
    in this example: reture should be "cbes" or "/cbes"
    how?
    thanks alot.

    getContextPath() in javax.servlet.http.HttpServletRequest

  • I just cancel the root user (me)... How can I get it back ?

    I just cancel the root user (me)... How can I get it back ?

    I can't open Preferences > Users anymore!!! Please help!

  • How do I get a handle on embedded sound files?

    From the Sound Class information, it says to use the SoundMixer Class to handle embedded Sound Files.  I have two sound files embedded, that I have setup in 2 separate layers, starting at frame one in the main timeline.  I needed to do this so I could see the wave files, and coordinate text with the waves.  I do not want to load these files into the .swf file at runtime using URLRequest.  How do I get a handle on those as they exist, to make each controllable by separate volume and mute controls for each sound?
    This will be a challenging question, because, "it can't be done" doesn't work for me.  I managed to create a way to use an external classfile to control the main timeline, the ROOT timeline, without having to create a sub movie to root.  I can use my component to call play(); as though it were in code in a frame.  But it isn't, it's in an external classfile.  I passed root to the classfile and told the classfile to think of it as a movieclip - that put the handle on it.  I tried similar way with root as a Sound, but that isn't detailed enough - I need to get a handle on the frame that contains the embedded sound file.  I embedded, attached it, using the properties view for the frame.
    I've attached, or whatever you want to call it, these sound files to a frame, and this frame is or should be attached to the layer I've created.  So, under the assumption that the ROOT has everything attached to it in some manner (it is after all the foundation for the COM), the stage of the root contains the visual components, so ROOT has to have the layer objects attached to it, which should have the frame objects attached to the layers.  I have two layers that each have a .wav file attached to frame one.  Somehow Flash keeps track of that - I want to know how Flash does it so I can read what flash reads.
    If this seems redundant, it probably is.  I want to paint the best picture I know how so I can get detailed feedback.  Please, if you have questions ask them so we can clarify, and get this resolved!  Thanks for reading!

    lol.
    ok, it can be done.  keep working on it.

  • I have a Pages document in iCloud that will not open. I have Time Machine. How do I get to the version of the document that is not corrupted?

    I'm in a bind. I tried to open a Pages document that I saved from the current version of Pages on my iMac this morning on my iPad, which has the current version of Pages of the iPad. It would not open on the iPad. Now it also will not open on the iMac, or on the Beta of iCloud Pages.
    If it were on my hard drive, I could use Time Machine to recover the most recent version, but it's in iCloud. I've been told that implies that there is a local copy, but I don't know where that is.
    It's a book manuscript I've been working on for months. I'm not happy.
    Thanks for the help.

    Your opinion of Apple products seems unusually harsh. I know how iCloud works and I'm generally pretty happy with it. I also like Pages a lot more than MS Word, and somewhat more than NeoOffice. Word is overripe with so many features Microsoft keeps radically changing the interface in the desperate hope that somehow they will make it easy to use again, but instead, they just confuse everybody with the unnecessary changes.
    They had menus, until there were too many options to fit the screen, so they added submenues, until that wasn't enough, so they added dialog boxes, until that wasn't enough, so they added tabbed dialog boxes, and realized that a lot of commonly used features were too hard to get to, so they added the Toolbar just as a shortcut to the more common features and then came up with the unforgivable decision to eliminate the menu interface entirely in the Windows version of the product and replace it with The Ribbon, which took me so long to interpret that I stopped using Word altogether.
    NeoOffice is simpler and quite useful, but it was iCloud that sold me on Pages. It's great being able to review and edit documents on iOS devices in addition to automatically synchronizing across Mac OS X devices.
    I have options for synchronization with Box and DropBox, and I have a network share I can use, if having a local copy isn't important, but I find that having a local copy (like with Box, DropBox and iCloud) is great because each computer I use has Time Machine, so I don't have to rely on the service to restore a file. I can get it, myself. It's easier to browse to the version I want in Time Machine than it is to estimate the time I want to restore from and hope that someone else can find the right version of the file from whenever they made a backup to restore it for me. I have unhappy experiences from this kind of request to restore stuff.
    I find Box and DropBox to be somewhat crude compared to iCloud. I like Apple's new attitude toward saving files. When I edit in Pages and exit, the file is saved. If I edit a file and the power goes out, I generally lose a sentence or less. In traditional apps, I can easily lose hours of work, unless I remember to manually save as I go.
    iCloud is not a general remote file storage facility. At it's root, it is a roaming version of whatever you have on iOS devices. So, if I want to access a file from multiple devices and not have to worry about versions, I use iCloud.
    This problem I just had was the first problem I've had with iCloud, and with Time Machine, and I use them a lot. Having someone tell me where the local copy of the documents are fixed the problem.
    I love Time Machine.
    For myself, when I upgraded from Bento 1 to Bento 2 on several computers, one of them choked on my data file. I followed Bento's directions to recover the data file until it said to reinstall Bento 1 from original medium. I couldn't find my disc. Yes, I had bought it. I don't steal software. But I couldn't find my disc.
    So, I used Time Machine to restore Bento 1. Just try restoring an older version of an app in Windows from any backup software available to Windows and see how far you get.
    I helped someone else recover a couple thousand email messages using Time Machine instead of dealing with the email service because we could open Mail, go to the folder where the messages had disappeared when she had a power glitch, and then browse back until we found the backup just before the messages disappeared. The restore took about 20 minutes, but again, this verges on magic.
    I've used Time Machine to restore an older version of OS X when someone discovered that a crucial app wasn't ready for it yet. The glitch was that she hadn't backed up for a month. She kept ignoring the warning prompts. So, when I showed up, I had her do a current backup before doing the restore. We then restored to the old OS, restarted in the old OS and opened Time Machine to recover all her documents, pictures, etc. from the current backup, so she didn't lose a month of work. This is another thing I can't do with other backup programs.
    So, I'm generally pretty happy with Apple. Once someone told me where the local copy of my iCloud documents resides, I could take care of this most recent problem.

Maybe you are looking for