• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2331
  • Last Modified:

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

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

For example, if a user is at:

http://mywebsite.com/myfirstfolder/mysubfolder/
 2nd example

http://mywebsite.com/myfirstfolder/mysubfolder3/

but no template name


Regards
0
xeondxb
Asked:
xeondxb
1 Solution
 
_agx_Commented:
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>
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now