Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cant get virtual server side include (SSI) to work.

Status
Not open for further replies.

gus121

Technical User
May 9, 2002
298
GB
Hi I am running W2000 IIS5
I have a problem with Server Side Includes (SSI).

The following works:

<!--#include file=&quot;../inc/left_navi.inc&quot; -->

The following does not:

<!--#include virtual=&quot;/inc/left_navi.inc&quot; -->

I get the following error:
HTTP/1.1 404 Object Not Found Server: Microsoft-IIS/5.0 Date: Tue, 02 Sep 2003 14:18:25 GMT X-Powered-By: ASP.NET Connection: close Content-Type: text/html
404 Object Not Found

Are there settings that need to be set in IIS?

thanks for all your help.

regards

Angus


Angus
 
Try Thread333-663199 and see if it helps.

First of all, one of the suggestions in the ASP forum faq333-1518 strongly recommended naming your include files .asp so that if anyone was able to guess the file name or otherwise get to them, the server would process them first as ASP and the prying eyes couldn't see any server-side code.

I experimented with the file= method but never got it to work for me when I was trying to access &quot;cousin&quot; files. For example, I was in \inetpub\ and I wanted to access a file in \inetpub\ Maybe it was my version, who knows... So I went virtual:

<!-- #include virtual=&quot;\template\code1.asp&quot; -->

The above code requires that the virtual directory that exists. It is not a real one, but more like a pointer to the actual directory. To view them, go into the M$ Management Console (MMC). There you will see the file structure tree. Under the Default Web Site object you may see some blue colored icons - those are virtual directories. If you look at the properties you'll see the drive/directory it points to, whether it allows scripts to run, be read or written to, etc. Beware: for security reasons do not allow both writing and running scripts (such as for uploads) in the same directory!

If you want to create a virtual directory, right-click on Default Web Site and select New, Virtual Directory.

dbMark
 
Hi Mark,
Thanks for your help. Since I submited this post in this forum. I have solved the issue that I had by setting up virtual directories as you described and giving each a unique host header and setting DNS settings for each.

I did see a similar post a few weeks ago on anouther website warning me that .inc extention to the include file on asp pages was a security risk as you could browse to the page. However I have found that in Windows server 2003 this security loop hole has been pluged. It is no longer an issue and just brings up a custom 404 page when attempt to browse too pages with this extention.

I also found that when moving a website to W2003 that you have to allow parent paths before the include file paths will work as follows <!-- include file=&quot;..\somepage.inc&quot; -->.

Anyway thanks for your help. If there is anything I have writen above that is incorect please tell me.

Kind regards,


Angus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top