Linking to non-concrete folder and keeping Referring domain name

Permalink
OK, this one get complicated. On our old site we used numerous different domain names pointed to the site. This was mainly for our main resellers. Our actual order form had PHP code that would write the referring domain name to the order form - that is how we tracked orders.

Just moved the entire site into concrete5. The process above no longer works - it always puts the main domain name on the order form even if a visitor come into the site via a different name.

The problem is two fold - First, because of the extra PHP and other functions of our order form, we had to keep it and related files in a separate folder other than what concrete installs/uses. So on the link to the order form - it has to point to this non-concrete (but in root folder) folder.

Secondly, as mentioned, even if you come in via a different domain name, when you click the link to load the order form - it always uses the main domain name as the referrer. I believe it the way concrete dynamically creates the links?

The current link to the order form is
<a href="{CCM:BASE_URL}/vcheckorderforms/order-online-by-credit-card.html">

I assumed the {CCM:BASE_URL} would have maintained the referring domain name - but it does not.

I have tried to use the refer php code in the link - but concrete doesn't like php inside a content block. So, does anyone know if it's possible to link to a file outside of the basic concrete folder, yet maintain the referring domain name throughout?

For reference: http://vchecksolutions.com is the primary domain name. http://insurancebind.com is another name pointed to the same site. http://vchecksolutions.com/order-check-phone-now/... contains the link to the credit card order form near the bottom. The credit card order form (not done in concrete) contains the following code that worked on the old site:

<FORM action="<?echo $_SERVER['PHP_SELF']?>"
name=ssnet method=post>
<INPUT type=hidden name='domain' value='<?echo $_SERVER['HTTP_HOST']?>'>

There is a case of virtual beer in it for whoever can help figure this out :-)

ssnetinc