Forum Moderators: phranque

Message Too Old, No Replies

How can I get SSI to work within directories?

base tag works with everything but .shtml files

         

Rightz

10:14 am on Jun 17, 2006 (gmt 0)

10+ Year Member



I'm sorting out my website into directories and have SSI files for navigation. I've used the base tag for images and links but it doesn't work with my .shtml files...

what can I do?

I should probably mention I'm using php includes:

<?
include('basicsleft.shtml');
?>

Thanks

Rightz

10:20 am on Jun 17, 2006 (gmt 0)

10+ Year Member



Ok I've got it working by using the entire path:

<?
include('http://www.example.com/basicsleft.shtml');
?>

Is there an easier way?

jdMorgan

4:08 pm on Jun 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about using

<?
include('[b]/b[/b]asicsleft.shtml');
?>

(This discussion would likely be more productive in the PHP forum).

Jim

encyclo

5:19 pm on Jun 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For PHP includes, you have to specify the path from the server root rather than the document root (unlike SSI). You can get around this restriction by specifying the document root like this:

<?php include($_SERVER["DOCUMENT_ROOT"]."/basicsleft.shtml") ;?>