Seperate Includes directories??

liunx

Guest
i seperate the different pages of my site with different directories. I use ssi because i use the same header, navigation, and footer on each page. I tried making one "includes" folder that was uploaded to the site that all index pages and webpages could access. For some reason it did not load the include unless i made a seperate folder in the directory. for example

i have a hompage that has an index.asp file, an image folder, an includes folder, a css folder, a buyers folder and a sellers folder etc.

in the buyers folder and the sellers folder i have index files also. in these files i tried to reference the main includes folder but it did not work.

to make it work ive included an includes folder in each of the subdirectories/folders in teh website. this isnt too bad but whenever I change something i have to make sure to copy to each of my subfolders and there are a lot of them.

can i make one includes folder and direct all includes to those file? ive tried and failed so that is why i am here

here is the code that i currently use that works but i have to have an includes folder in each of the directories and i have to copy all the files each time i change somehting.


<!--#include file = "includes/header.asp" -->
<!--#include file = "includes/navigation.asp" -->
<p> </p>

<!--#include file = "includes/footer.asp" -->

i tried to use thinking that one includes folder would be enough but it did not work for me, i figured that if i put the exact location of the file including the whole address it would find the includes and use them for all the pages.


<!--#include file = "http://correia-realty.com/includes/header.asp" -->
<!--#include file = "http://correia-realty.com/includes/navigation.asp" -->
<p> </p>

<!--#include file = "http://correia-realty.com/includes/footer.asp" -->i answered my own question if anybody searches this thread.

instead of using:

<!--#include file = "includes/header.asp" -->

i used:

<!--#include virtual = "/includes/header.asp" -->

if you use the top code then you have to put an includes directory into each subdirectory. IE will not allow you to put a forward slash in front of the includes when you use the term "file"

if you use the term"virtual" instead then you can put a forward slash in front of the includes and have only One includes directory in your site.

I used a tutorial on this site to learn ssi but using "virtual" instead of "file" helps a lto when you are trying to use just one insludes directory for the whole site
 
Back
Top