You are here: Administrators Reference > Site Administration > Static Content Generation > Initial Static Content Generation > Custom Code Cleanup > Remove cgi.script_name references

 

Remove cgi.script_name references

Another rule to keep in mind when writing any custom ColdFusion code that renders on a page is that the cgi.script_name variable will not be correct when under static content. The static generation background process calls internal caching APIs to build the static version of the page. Therefore, you cannot rely on the cgi.script_name variable to be set. Instead, you can use the request.page.filename and request.page.subsiteid to build the correct file URL. For example:

scriptname = request.subsitecache[request.page.subsiteid].url & request.page.filename;

 

Related Links


You can download PDF versions of the Content Contributor's, Administrator's, and Elements Reference documents from the support section of paperthin.com (requires login).


For technical support:

http://www.paperthin.com/support/