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 and to build the correct file URL. For example:

scriptname = request.subsitecache[].url &;


Related Links

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

For technical support: