#include virtual not working after CGI platform change
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- #include virtual not working after CGI platform ch...
#include virtual not working after CGI platform change
05-06-2014 4:09 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Since the change to the new CGI platform I can't get #include virtual tags to work.
All of my pages include a link to a footer page:
<!--#include virtual="/includes/footer.html" -->
The page opens fine if I address it directly, and if I copy and paste the html from the footer page in place of the #include tag it works.
I've tried removing the first slash in the path and even moved the footer.html file into the same folder as the page that calls it and removing the forward slashes and folder name from the path but it still won't include the file.
This all worked before the CGI change.
Am I doing something wrong or is this a feature of the new CGI platform?
Thanks in advance,
Matt.
Re: #include virtual not working after CGI platform change
06-06-2014 9:46 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Or is there a way for me to check an error log so I can dig a bit deeper into this?
I'm assuming that I must have the path right as on one page I link to a pdf form which is also in the /includes directory and that works fine...
Re: #include virtual not working after CGI platform change
06-06-2014 11:02 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
In your case I assume you want the server to parse all .html files. Have you included
AddHandler server-parsed .html
in .htaccess?
The following HTML
<p>The date and time are inserted using an SSI tag<br />
<!--#echo var="DATE_LOCAL" --></p>
provides an alternative way to check if SSI tags are working.
David
Re: #include virtual not working after CGI platform change
06-06-2014 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
That was it - I added the line into .htaccess, refreshed the page and bingo there it was.
Thanks for your help, much appreciated.
Regards,
Matt.
Re: #include virtual not working after CGI platform change
11-06-2014 6:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I appear to have a similar problem, but my .htaccess looks to be OK:
AddType text/html .shtml
AddHandler server-parsed .shtml
DirectoryIndex index.shtml
The website's index.shtml page loads fine.
This page has an SSI include which looks like:
<!--#include virtual="sometext.inc" -->
which worked (on PAYH) but now fails with 'an error occurred while processing this directive'
sometext.inc has permissions 644
I noticed however that if I try to view sometext.inc directly via the browser, I get a 403 "You don't have permission to access /sometext.inc on this server."
A red herring.?
Spraxyt's test:
<p>The date and time are inserted using an SSI tag<br />
<!--#echo var="DATE_LOCAL" --></p>
works.
Any ideas pls anyone?
Re: #include virtual not working after CGI platform change
11-06-2014 8:03 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I use include file=... rather than include virtual= and that works with .txt and .shtml files; examples
<p><!--#include file="include.txt" --></p>
<p><!--#include file="include.shtml" --></p>
... but the OP said include virtual=... worked.
An SSI directive nested within include.shtml works too (but not if within include.txt - because that is not marked server-parsed I expect).
Re: #include virtual not working after CGI platform change
11-06-2014 8:56 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I strongly suspect you are right - that Hostopia's version of Apache with my usual .htaccess directives is unwilling to #include files which are not .txt or .html, and that Hostopia's Apache config is different from both PAYH and PN Home pages in this respect.
I am about to check Apache's documentation on 'directives' and see if additional ones need inserting in .htaccess for file types other than .txt and .html
Re: #include virtual not working after CGI platform change
11-06-2014 10:28 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
On Hostopia's Apache, SSI #include will NOT include files of filetype .inc (As Spraxyt says, .txt and .html are fine)
PN Home pages and PAYH servers, #include WILL include files of filetype .inc
Using an AddType text/html .shtml .inc in .htaccess makes no difference
Using .inc appears valid according to Apache documentation. So is this a known server setup problem? And is there an easy solution?
Re: #include virtual not working after CGI platform change
11-06-2014 11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Re: #include virtual not working after CGI platform change
12-06-2014 10:13 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I tried inserting a .inc in just about every .htaccess directive but it makes not a jot of difference. I also tried different browsers (although this should make no difference at all since parsing is an Apache function).
But - logically - if SSI is working at all (which it is clearly is), it is Apache's (and only Apache's) job to decide from the zillions of file extensions possible which ones are acceptable.
Setup fudges apart, Apache should looking at directives its own Configuration files and then in .htaccess (or .htaccess'es is there is a hierarchy of them - I only have one!). And its Configuration files directives should be telling it what directives in .htaccess should be acted upon and which ignored.
All I know is that .inc was allowable in CCGI and PAYH Apaches but not in Hostopia's.
I have worked around this at present with some code changes and by moving some code outside of PN/Hostopia (the .inc files are written by PHP but SSI-included in Home Pages pages, so it is not just a matter of renaming a file or two).
There may, of course, be a wonderfully simple .htaccess directive such as:
AddHostopiaFudge .inc
This probably needs Bob or someone from Hostopia to follow up and let us know what is allowed by their Apache setup.
Re: #include virtual not working after CGI platform change
12-06-2014 11:34 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Part of that configuration restricts where particular classes of settings can be changed and I guess allowing .inc files to be served is disallowed via .htaccess.
Re: #include virtual not working after CGI platform change
12-06-2014 3:45 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Give me a nudge here though once you've done this.
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: #include virtual not working after CGI platform change
12-06-2014 5:09 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: #include virtual not working after CGI platform change
12-06-2014 5:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: #include virtual not working after CGI platform change
13-06-2014 9:48 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: decomplexity On Hostopia's Apache, SSI #include will NOT include files of filetype .inc (As Spraxyt says, .txt and .html are fine)
I've now had confirmation from Hopstopia's Security Team that the inclusion of .inc files is not permitted as a security safeguard. As we've already determined, other commonly used SSI file extensions are allowed e.g. asp, txt, cgi etc.
I don't expect there's a workaround other than to use a different file type/extension.
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- #include virtual not working after CGI platform ch...