Log in

View Full Version : Server Side Include Problem



brayd
09-07-2008, 09:42 PM
I'm trying to insert my logo, a tagline and a small navigation bar in the branding section of my home page using Server Side Includes but its not working. All that's displaying is a big white space where everything should be. The branding section is at the very top of the home page and is sometimes referred to as the header section.

To see the problem please visit the following URL:

www.gochecksite.com

My file structure is as follows and I've listed the folders and files "in the exact order" when I open my public_html folder when uploading files to my server:

cgi-bin folder

css folder

images folder

include folder (contains my branding.html file that I'm trying to insert using Server Side Includes)

.htaccess file

eng-benefits.html file

index.html file

Below is the code on my home page that I'm using to insert the Server Side Includes:

<div id="branding">
<!--#include virtual="include/branding.html" -->
</div>

Below is the contents of my branding.html file:

<a href="index.html"><img class="positionlogo" src="images/logo.gif" alt="" /></a>

<img class="brandingtagline" src="images/brandingtagline.gif" alt="" />

<div class="brandinglinks">
<ul>
<li><a href="#">English</a></li>
<li><a href="#">French</a></li>
<li><a href="#">Spanish</a></li>
<li><a href="#">Russian</a></li>
<li><a href="#">Chinese</a></li>
</ul>
</div>


What do I have to do to get the Server Side Includes working so it inserts the contents of my branding.html file?

brayd
09-08-2008, 01:45 AM
My Server Side Includes problem has been resolved. I had to adjust my .htaccess file by adding "AddHandler server-parsed .html". Now everything works just fine.

jbert
09-08-2008, 02:18 AM
Brayd,

Is every page in your site .shtml? If so please read my post a couple of lines under yours. My index page works great with 3 includes but link pages will not display.


JIM

jscheuer1
09-09-2008, 03:53 AM
With includes things can get tricky. Paths on the included page will be relative to the page(s) that they are included on. For this reason it is best to use absolute paths on pages that will be included on other pages.