Home and Parent variations with SSI
I’m not sure if this is the proper place to ask this question, it does sort of deal with server management, so here it goes.
I’m trying to work out a conflict with server side includes between IIS running on my development platform at home and Linux running on my hosting server. The conflict has me in a catch-22.
I have a virtual host pointing to C:\MySites\NewDomain on my IIS server at home and I have NewDomain virtual hosted at the Linux server. On both servers I have files in the root directories and also a subdirectory called HowTo. In the HowTo directory I have an shtml file that needs to include the website banner which exists in an htm file in the root directory. Hope everyone followed that, now here is the problem.
On the IIS server at home I can reference the banner file as:
<!--#include file=”../banner.htm”--> and it works fine.
On the Linux Server I get the message “an error occurred while processing this directive” because it cannot resolve the path.
On the Linux Server I can reference the banner file as:
<!--#include file=”/banner.htm"--> and it works fine.
On the IIS Server I get an error because “/” points to “c:\InetPub\wwwRoot”, not the root fo the virtual domain.
What works for one fails on the other. I want to be able to create and test the files at home then upload them as is to the Linux Server.
I need either of the following questions resolved:
How can I get the Linux Server to recognize ../ as the parent directory?
How do I get My IIS service to recognize / as the home directory of the virtual host?
Thanks in advance
Last edited by PapaGeek; 02-21-2009 at 09:08 PM.
Why not just install apache on the windows box and copy the settings as needed? This would eliminate the IIS issues altogether.
Thanks for the response criterion9,
That is the direction I might have to head, but I want to eventually share my techniques for web design and maintenance with others, so I'm looking for a universal set of rules that will work on both Windows and Unix/Linux.
I worked on the problem more last night and did come up with a sort of workaround.
../ does take you to the parent directory for things like src=whatever.css and most other uses. The problem only seems to exist for the include file directive. One way around this problem is to place all of the shared include files in a directory off of root, like /include/header.htm. The IIS server unfortunately has an issue with this because / always refers to the document root, C:\InetPub\wwwRoot. The way around this problem is to create a unique include directory name for each domain, place that directory in the root directory of the domain you are constructing, and use the control panel to create a virtual directory inside IIS to point to the include directory inside your document root. This way the structure of the files on your development platform will match published website.
I have a Windows Web Server and a Linux Web Server to play with on line. I also have IIS installed on one of my development systems and XAMPP installed on the other. What I’m looking for is the Universal set of rules for developing on either platform to be publish on either platform. At least when ASP and PHP are not involved!
Thanks again for the assist
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)