Andrew Posted December 8, 2004 Posted December 8, 2004 I made some minor tweaks to a section of my site (www.kantor.com/blog), which sports a server-side include. Specifically, it includes a file called "nav.html" that sits in my root (public_html) directory. This way I can have the same navigation links on every page. Now something weird is going on. My main blog page -- http://www.kantor.com/blog -- has that nav.html file show up just fine. But the monthly archive pages, e.g., http://www.kantor.com/blog/2004/12/index.shtml, will NOT show that nav.html file. I get the infamous "[an error occurred while processing this directive]" message. I use the same code on both pages: <!--#include virtual="http://www.kantor.com/nav.html" --> I believe the permissions are OK (it works some of the time, after all), and I tried using 'include file' as well. But it just won't appear on the other pages. Any suggestions about this? I figure I'm missing something obvious, but can't figure out what. Thanks! Quote
TCH-Bruce Posted December 8, 2004 Posted December 8, 2004 (edited) Have you tried replacing the http include string with the root path? <!-- #include="/home/cpanelname/public_html/nav.html" --> Edited December 8, 2004 by TCH-Bruce Quote
Andrew Posted December 8, 2004 Author Posted December 8, 2004 Ooh, no. Hadn't thought of that. I *did* try using the full path (http://...). I'll give it a shot. Thanks! Quote
Andrew Posted December 8, 2004 Author Posted December 8, 2004 Nope -- no dice. What's weird is that the same include is in the other page, but without any problems. Argh! Quote
TCH-Bruce Posted December 8, 2004 Posted December 8, 2004 (edited) What's weird is that the same include is in the other page, but without any problems. While it may be the same include you are several levels down in your directory tree. Have you thought about changing to using a PHP include instead of the SSI include? It would look like this: <?phpinclude $_SERVER['DOCUMENT_ROOT']."/nav.html"; ?> Edited December 8, 2004 by TCH-Bruce Quote
Andrew Posted December 9, 2004 Author Posted December 9, 2004 I cut and pasted that code, but it didn't work. I'm guessing that I'm supposed to change something to make it specific for my site. At least the error is gone; now it's just blank. Quote
TCH-Bruce Posted December 9, 2004 Posted December 9, 2004 In your .htaccess file add the following to use the PHP include. AddType application/x-httpd-php .htm .html .shtml Quote
Andrew Posted December 9, 2004 Author Posted December 9, 2004 Ach, now Firefox asks what to do with the .shtml file -- it won't just open it. Quote
Andrew Posted December 9, 2004 Author Posted December 9, 2004 And I'd really like to know what the include doesn't work anymore. Nothing against PHP, but the include command has always been very very good to me! Quote
TCH-Bruce Posted December 9, 2004 Posted December 9, 2004 Can you change your archive pages to .html? And you could remove the .shtml from the AddApplication entry in the .htaccess file. Quote
Andrew Posted December 9, 2004 Author Posted December 9, 2004 The problem is that the include command is in a lot of my pages (and only these monthly pages aren't working). So I need the .shtml to keep the rest of the site functioning properly. Quote
TCH-Bruce Posted December 9, 2004 Posted December 9, 2004 (edited) What other SSI includes are you using? You could also put a copy of the nav.html file in your archive folder and use the SSI include <!-- #include file="nav.html" --> Also my example was wrong: <!-- #include="/home/cpanelname/public_html/nav.html" --> Should have been: <!-- #include file="/home/cpanelname/public_html/nav.html" --> Edited December 9, 2004 by TCH-Bruce Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.