32209 Posted January 27, 2010 Report Posted January 27, 2010 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 ("http://mysite.com/mystuff/pages/navigation-vertical.txt");?> Quote
Tony Posted January 27, 2010 Report Posted January 27, 2010 You're not literally using are you? As in you're doing http:// then your actual site and the page. I don't believe SSI does URL's you're suppose to use relative paths to the files. Quote
Tony Posted January 27, 2010 Report Posted January 27, 2010 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 Quote
32209 Posted January 27, 2010 Author Report Posted January 27, 2010 (edited) 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 January 27, 2010 by 32209 Quote
32209 Posted January 27, 2010 Author Report Posted January 27, 2010 Probably a silly question, Tony, but "SSI and Allowoverrides is enabled for this particular website/domain, right"? Support said yes, but I am asking again to be sure I did not misinterpret support's answer. Quote
Tony Posted January 27, 2010 Report Posted January 27, 2010 Should be unless we specifically turned it off on you. You might want to see if SSI is enabled and it's an issue with the virtual include. So add the following: If it parses then the issue must lie with loading your other files. Quote
32209 Posted January 27, 2010 Author Report Posted January 27, 2010 (edited) 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 January 27, 2010 by 32209 Quote
Tony Posted January 27, 2010 Report Posted January 27, 2010 I fixed it for you AddType application/x-httpd-shtml .yourextension You had AddType text/html .yourextension In process found a bug it messes up .shtml when setting an addtype of text/html Quote
32209 Posted January 27, 2010 Author Report Posted January 27, 2010 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. Quote
32209 Posted January 27, 2010 Author Report Posted January 27, 2010 Thankyou for pointing that out, Tony. Your suggestion did fix the problem. I had a misspelling in one of my file extensions. 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.
Note: Your post will require moderator approval before it will be visible.