Hi,

I know how to include header.shtml file using ssi command

but don't know how to include header.ssi file.

I tried using same command but it doesn't work.

For my assignment we have to use header.ssi file

Thanks

Dani AI

Generated

fixed the misspelling, but if the included file still shows no content there are a few common, verifiable checks to run before posting code (as suggested) or assuming a browser/CSS problem (as wondered).

  • Confirm the page is served by a webserver (SSI runs only via HTTP, not file://).
  • Put plain text in header.ssi to verify includes work (quick test):
This is a simple SSI test line.
  • Check include directive syntax. Use file for a filesystem-relative include, or virtual for a web-root path:
<!--#include file="header.ssi" -->
<!--#include virtual="/includes/header.ssi" -->
  • Make sure the parent page is being parsed for SSI (many hosts only parse .shtml by default). Example .htaccess to enable parsing in that directory:
Options +Includes
AddHandler server-parsed .shtml
AddType text/html .shtml
  • Verify file permissions (e.g., 644) and look at server error logs for permission or include errors.
  • If header.ssi contains only <meta>, <link>, or <title> elements, they will not appear visually on the page — inspect View Source to see if the include was injected.

When seeking further help, include the exact include line, the include file contents, the parent page filename/extension, and the browser-viewed HTML output so responders can see whether the server parsed the SSI or not.

Recommended Answers

All 4 Replies

I misspelt filename ..lol

It works now with same command.

I have new problem now.

The content in header.ssi are not showing.

Please help.

Thanks

Without seeing some code and an active page to look at, there's not a lot people can do to help.

is that header.ssi related to html and css (confused)

All - the include file, the page it's going in, the resultant page from the browser, and the related css.
Of course, if the include file is only header information, then css doesn't apply as header info is only visible under 'view source'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.