Server Side Includes (SSI) not displaying


Recommended Posts

Can anyone tell me why server side includes(SSI) are not working on my website? After several hours of trying to solve it myself I asked Hawkhost support if SSI and AllowOverrides is enabled on my website. They said yes.

Nonetheless, I still can not get included files to show on my website. W3C validates the specific pages in question as HTML 4.01 Transitional, iso-8859-1, with no warnings or errors.

The includes are working fine on another, older, Hawhost hosted site of mine. I even tried to use the cPanel preinstalled "Random HTML" script, which uses an include statement, and it will not work, either.

I have added and removed apache handlers and mime types, I have used .shtml on the pages in question, I have disabled .htaccess to see if that is the cause, I have added a .htaccess in the directory where the pages in question are located, I have changed the file extension of the included file, I have changed the file permissions for the webpages with includes in them to 754. After over 12 hours struggling with this issue I have done everything I can think of and used every suggestion I found searching the Internet.

To me the server does not seem to be searching/scanning for SSI at all because when I view the webpage source the actual include statement displays in the source. For example, shows in the source. I use this exact same method, including .txt, on another Hawkhost hosted site and, when I view source, the actual content of that file shows, which makes sense because that means the server is "processing" the include statement before it sends it to my browser. But, again, it seems to me that the server is not "processing" it at all in my current situation because the actual include statement displays when I view the source of the pages in question instead of the content of the included file.

I have tried including via: AND I have tried using <?php ("");?>

Link to comment
Share on other sites

Thanks for replying Tony.

My other guess would be that if you're using other extensions your htaccess code to do it is not right.

So for example I believe to do .html as ssi you'd do the following:

addtype application/x-httpd-shtml .html

I have used relative and absolute paths, to my recollection, on other websites. I changed the paths to relative and the included file still does not show up.

I changed it to and to and to for various attempts as well.

I tried addtype application/x-httpd-shtml .html and that did not appear to resolve the issue, either.

I intend to log in to the cPanel for the website on which the includes are working, again. I will scrutinize my MIME types and Apache Handlers on that website closer. Hopefully, the difference will be obvious.

I do not expect that the problem is related to anything I have in .htaccess, because I disabled .htaccess and the includes still did not show while it was disabled. I have also added various "statements" to .htaccess, such as, Options +Includes, Options +FollowSymlinks, etcetera. I even tried to use the cPanel preinstalled "Random HTML" script, which uses an include statement, and it will not work, either.

Update: Unfortunately, I don't see any differences in the User defined MIME types and Apache Handlers on the other website where SSI is working that help to resolve the issue on the website, this one, where they are not.

Edited by 32209
Link to comment
Share on other sites

Thanks for replying, Tony.

I copy/pasted:


It did not parse. The webpage did not show any date, or anything different. W3C still says the page is valid code.

I disabled .htaccess by removing the period. Should I do more to disable .htaccess than removing the period?

note: I am using a custom extension instead of .html or .htm or .shtml on the website encountering this issue, but I am using custom extensions on the older website where includes are working as well.

Edited by 32209
Link to comment
Share on other sites

Thanks for replying Tony.

I tried that. It throws a 404 not found error on the page that contains the include.

That particular page I have been using for a while; so, I do have a few visitors who look for that page every now and then.

I will PM you the actual URL of the page, one of them, that I want to use the includes in.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.