How do I get the entire current URL from ColdFusion without Template Name?

Posted on 2012-08-29
Last Modified: 2012-08-29
How do I get the entire current URL from ColdFusion without Template Name?

For example, if a user is at:
 2nd example

but no template name

Question by:xeondxb
    1 Comment
    LVL 51

    Accepted Solution

    You can either use CGI variables or get the url from the pageContext

    <cfset requestURL = getPageContext().getRequest().GetRequestUrl()>
    <cfset withoutTemplate = getDirectoryFromPath(requestURL.toString())>
    <cfoutput>withoutTemplate = #withoutTemplate#</cfoutput>

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now