I am using below code to get current page URL in coldfusion :-
host = structKeyExists(cgi,'http_host') ? cgi.http_host : '';
req_url = 'https://' & host & cgi.script_name;
But in req_url parameter I am getting host_name/index.cfm instead of current page URL. I am getting actual URL in referrer. Please let me know how to get current page URL in coldfusion.
Protocol = #getPageContext().getRequest().getScheme()#;
Domain = #cgi.server_name#;
Template = #cgi.script_name#;
Variables = #cgi.query_string#;
So for example:
Canonical = '#getPageContext().getRequest().getScheme()#://#cgi.server_name#/#cgi.script_name#?#cgi.query_string#';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With