thisurl

[thisurl] displays the URL of the current page. Inserting [thisurl] in your template displays the URL of the current page being displayed as a relative path from the root of the server hierarchy. It will not show the domain name.

Example WebDNA code:
[thisurl]
Results:
When used on a page such as http://www.domain.com/x/y/z/index.dna?a=b&c=d [thisurl] will return /x/y/z/index.dna, note the return stops at the ?

If the variables from a url are also required such as a and c from this url:
http://www.domain.com/x/y/z/index.dna?a=b&c=d then use [thisurlplusget]


[thisurl] when writing "Pretty URLs" using .htaccess
When writing "pretty urls" using .htaccess [thisurl] will NOT return the rewritten url, however there is a workaround if the "requested URL" is required.

Example:
# This rule is to manage products when URL = http://domain.com/department/[DEPT-URL]
# Example: http://domain.com/department/clothing
RewriteRule ^department/([a-z,0-9\_\-]+)$ /department-display.dna\?d=$1 [NC,L]

In this example the results of a "department" are displayed using this URL http://domain.com/department/clothing, then using RewriteRule the required data can be displayed by sending the DEPT-URL to be processed by /department-display.dna\?d=$1.

This may not be ideal if you want to use the requested URL for further navigation as [thisurl] will return "/department-display.dna" or "/department-display.dna?d=clothing" if using [thisurlplusget].

By capturing the request_uri and passing the value as a variable to the WebDNA page simpley add it as a variable to the end of the rewrite string:
/department-display.dna\?d=$1&varREQUESTSTRING=%{request_uri} << note this is uri not url

Now on the WebDNA page:
varREQUESTSTRING = [varREQUESTSTRING] will display the original requested string as:
varREQUESTSTRING = /department/clothing