My site using URL Rewrite to make SEO friendly URLs. This makes self-posting a form back to the same page a little tricky.
However in ColdFusion I do this for the form's action attribute:
<form name="formSortBy" method="post" enctype="multipart/form-data" action="#StructFind(GetHttpRequestData().headers, 'X-Original-URL')#">
</form>
The important part here is the #StructFind(GetHttpRequestData().headers, 'X-Original-URL')#
which gets me the URL of the page.
However the X-Original-URL
key just doesn't exist on some pages so I get an error from ColdFusion saying:
Cannot find X-Original-URL key in structure.
The specified key, X-Original-URL, does not exist in the structure.
This is happening when I click to go to the homepage of a section I am in.
So X-Original-URL
exists if I go to http://www.sitename.com/products/gaming
but it won't exist if I go just to http://www.sitename.com/products
Is there anyway to get around this or make it work like I need it to?