I have an application that I create in ColdFusion, in which all requests will be executed through the index.cfm file.
I have a .htaccess file that rewrites a URL. So for example ... if I write:
http://domain.com/hello/goodbye/howdy
The actual query always uses index.cfm as follows:
http://domain.com/index.cfm/hello/goodbye/howdy
All this works fine, but now I'm stuck on how I can capture everything that is in the url. None of the CGI variables seem to display a portion of the URL "/ hello / goodbye / howdy".
I tried cgi.path_info and cgi.query_string etc. to no avail ... they are just empty.
I need to grab everything that comes after the domain name and do something in CF with it. I know this is possible in JS, but I really need it on the server.
Dropping the CGI area shows me nothing useful in this regard:
<cfdump var="#cgi#" />
Here is my htaccess file for reference:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.cfm$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.cfm [L] RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} !^([^\.]+)\.domain\.com RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule>
Thanks.
EDIT:
As an additional note, I also tried using basic Java methods as follows:
<cfdump var="#getPageContext().getRequest().getContextPath()#" /> <cfdump var="#getPageContext().getRequest().getRequestURL()#" /> <cfdump var="#getPageContext().getRequest().getQueryString()#" />
Without success: (