Forums

This topic is locked

Problems with Server-Side Includes

Posted 02 May 2002 14:55:16
1
has voted
02 May 2002 14:55:16 Arnold Ho posted:
Heres my current situation.

localhost/aerotus/index.asp --- shows my homepage on my computer.


when I add a SSI into it using UD, the 2 pages are in the same folder and level.
<!--#include virtual=header.htm"-->
localhost/aerotus/index.asp --- shows an error.


I make some changes
<!--#include virtual=\aerotus\header.htm"-->
localhost/aerotus/index.asp --- shows my homepage on my computer.


But why must I add \aerotus\ since the 2 pages are in the same folder and level?
Am I doing something wrong with IIS?

Replies

Replied 02 May 2002 16:12:07
02 May 2002 16:12:07 Viktor Farcic replied:
Use include file instead of virtual when referencing files in same folder as the page that call them. Something like:
<!--#include file=header.htm"-->
When they're in different folder use file with relative address:
<!--#include file=../otherfolder/header.htm"-->
or virtual with apsolute address:
<!--#include virtual=/otherfolder/header.htm"-->


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Heres my current situation.

localhost/aerotus/index.asp --- shows my homepage on my computer.


when I add a SSI into it using UD, the 2 pages are in the same folder and level.
&lt;!--#include virtual=header.htm"--&gt;
localhost/aerotus/index.asp --- shows an error.


I make some changes
&lt;!--#include virtual=\aerotus\header.htm"--&gt;
localhost/aerotus/index.asp --- shows my homepage on my computer.


But why must I add \aerotus\ since the 2 pages are in the same folder and level?
Am I doing something wrong with IIS?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager

Edited by - vfarcic on 02 May 2002 16:12:41
Replied 02 May 2002 16:54:40
02 May 2002 16:54:40 David Behan replied:
Something strange that I have never understood. Ultradev adds the SSI as "include virtual" but it never works on my PWS or Web Server so I always change it to "include file".

In my case, it's "don't ask why, just accept the fact"

Regards

_________________________
David Behan - www.bmor.com
Replied 02 May 2002 19:52:11
02 May 2002 19:52:11 scre wdanger replied:
This is what i also figured out. My files were not working, after checking out the code i found this "virtual" thing instead of "file". Does anybody know why???
Replied 02 May 2002 19:54:43
02 May 2002 19:54:43 scre wdanger replied:
I guess when one opens the asp file directly from the directory rather than opening the Ultra dev first then it writes the virtual path or?
Replied 02 May 2002 20:13:12
02 May 2002 20:13:12 Arnold Ho replied:
Hi! I kinda solved my problem.
I realised that my default website in IIS was localhost.

So IE was looking for

localhost/header.htm instead of
localhost/aerotus/header.htm

when I used
&lt;!--#include virtual=header.htm"--&gt;

What I did was to set the default website to localhost/aerotus, thus

&lt;!--#include virtual=header.htm"--&gt; makes IE look for
localhost/aerotus/header.htm


Is that the best solution?? Any comments?


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Use include file instead of virtual when referencing files in same folder as the page that call them. Something like:
&lt;!--#include file=header.htm"--&gt;
When they're in different folder use file with relative address:
&lt;!--#include file=../otherfolder/header.htm"--&gt;
or virtual with apsolute address:
&lt;!--#include virtual=/otherfolder/header.htm"--&gt;


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Heres my current situation.

localhost/aerotus/index.asp --- shows my homepage on my computer.


when I add a SSI into it using UD, the 2 pages are in the same folder and level.
&lt;!--#include virtual=header.htm"--&gt;
localhost/aerotus/index.asp --- shows an error.


I make some changes
&lt;!--#include virtual=\aerotus\header.htm"--&gt;
localhost/aerotus/index.asp --- shows my homepage on my computer.


But why must I add \aerotus\ since the 2 pages are in the same folder and level?
Am I doing something wrong with IIS?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager

Edited by - vfarcic on 02 May 2002 16:12:41
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic