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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server side includes

Status
Not open for further replies.

jimberger

Programmer
Jul 5, 2001
222
GB
Hello,

I have a .shtml page that includes other html pages. When i goto it it says cannot find file /location/htmlpage.html where the html page should go.

however when i type in the url for the html page the web server lets me view them. i have set Options includes in the directory directive in apache - any ideas why this wont work?

jim
 
Check to make sure these lines are in your httpd.conf file.

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
</IfModule>

AddType text/html .shtml
AddHandler server-parsed .shtml

 
Hi,

With SSI 'include file' includes you should use a relative path to the calling document. Absolute paths don't work. For example :

<!--#include file=htmlpage.html&quot;-->

Alternatively and preferably, you can use 'include virtual' where the 'path' is a relative URL :

<!--#include virtual=/whatever/htmlpage.html&quot;-->

You also need in httpd.conf (or .htaccess):

Options +Includes

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top