Forum Moderators: open
Today I discovered something in my logs that has all but panicked me! Someone came into the site calling the .html page twice, and rather than a 404 error (I would expect one!) they received a 200OK. I investigated, and found that my pages come up if you call the .html file twice, e.g.
www.example.com/page1.html/page1.html
Each place on the page where I have called an include, the "page1.html" starts over, nested inside of "page1.html"
Here is how I set up the SSI include in my pages:
<!--#include virtual="menubar.html" -->
my .htaccess file has these lines near the bottom of the file
#This is to parse all .html files for SSI includes
AddType text/html .html
AddHandler server-parsed .html
My ssi includes work perfectly fine, calling in the correct code that is in the menubar.html file, if the correct url is used, e.g. www.example.com/page1.html
This nesting thing really has me scratching my head. Does anyone have a suggestion for an alternate method that doesn't allow this to happen?
With SSI, as you are dealing with only snippets of markup not whole HTML documents, it is good practice to use a different extension for the include files. I prefer using .inc, and many use .txt - but using either will ensure that the includes are not parsed for further includes, which is maybe one possibility for what is causing your "loop".