Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with including files for ASP in IIS 7.5
    primarykey
    data
    text
    <p>thanks for taking the time to read this question of mine, which I'm sure is a school boy error but for the life of me, cannot see it.</p> <p>I have an ASP page which has the following contents:</p> <pre><code>&lt;!-- #include file="include.asp" --&gt; &lt;% Dim ConfigFile ConfigFile = Left(Request.ServerVariables("URL"), InStr(Request.ServerVariables("URL"),"/framework/lib/dms/asp/")) ConfigFile = ConfigFile &amp; "project/config/ConfigDms.inc.asp" %&gt; &lt;HTML&gt; &lt;HEAD&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;%=ConfigFile%&gt; &lt;/BODY&gt; &lt;/HTML&gt; </code></pre> <p>Which works when accessed as a stand-alone page, or when called via an iFrame (don't ask). However, if I add the line "include ConfigFile" the page returns a 404 error in IIS. The value of ConfigFile is "/cms/project/config/ConfigDms.inc.asp", as printed out in the body of the page.</p> <p>If I add the line "include <a href="https://xxx.xxx.xxx.xxx/cms/project/config/ConfigDms.inc.asp" rel="nofollow">https://xxx.xxx.xxx.xxx/cms/project/config/ConfigDms.inc.asp</a>" to replace the original include statement, it works as intended.</p> <p>Now I'm sure that this is a configuration error, but either though I put the ASP setting "enableParentPaths" to true and scrip "errorsenttobrowser" to true, I'm still not getting anywhere.</p> <p>I have identical code on another server running an older version of IIS and it is working fine, however, I never setup the original server and have no documentation for setting up the new server.</p> <p>The ASP script which causes the 404 error looks like:</p> <pre><code>&lt;!-- #include file="include.asp" --&gt; &lt;% Dim ConfigFile ConfigFile = Left(Request.ServerVariables("URL"), InStr(Request.ServerVariables("URL"),"/framework/lib/dms/asp/")) ConfigFile = ConfigFile &amp; "project/config/ConfigDms.inc.asp" include ConfigFile %&gt; &lt;HTML&gt; &lt;HEAD&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;%=ConfigFile%&gt; &lt;/BODY&gt; &lt;/HTML&gt; </code></pre> <p>But this file works fine:</p> <pre><code>&lt;!-- #include file="include.asp" --&gt; &lt;% Dim ConfigFile ConfigFile = Left(Request.ServerVariables("URL"), InStr(Request.ServerVariables("URL"),"/framework/lib/dms/asp/")) ConfigFile = ConfigFile &amp; "project/config/ConfigDms.inc.asp" include "https://xxx.xxx.xxx.xxx/cms/project/config/ConfigDms.inc.asp" %&gt; &lt;HTML&gt; &lt;HEAD&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;%=ConfigFile%&gt; &lt;/BODY&gt; &lt;/HTML&gt; </code></pre> <p>Regards</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload