Exclude "normal" HTML pages from being parsed
From phpCMS
If one wants to exclude some "normal" HTML pages ("static pages", full HTML-coded pages) from being parsed by phpCMS, there are several possibilities.
(A different approach would be to include a "normal" HTML page into one or more phpCMS content file(s). That subject is treated in this article.)
Contents |
[edit] Automatic detection
phpCMS includes an automatic detection of "normal" HTML pages: every time it finds the "<html>" tag in a file, it considers that page to be a "normal" ("static") HTML page and not a phpCMS content file. So phpCMS sends it directly to the browser "as is", bypassing the parser.
[edit] File extension
If one uses the Stealth Mode of phpCMS using e.g. AddType and Action directives one uses a .htaccess file containing
AddType application/x-httpd-parse .htm Action application/x-httpd-parse "/parser/parser.php?file="
which tells the web server (i.e. "Apache") to send all *.htm files in the directory where the .htaccess file is located and all its subdirectories to the parser.
All "normal" HTML pages could be named e.g. ".html" and would then bypass the parser.
This applies also to the other implementations of the phpCMS Stealth Mode in the sample.htaccess file.
Another possibility would be to use "*.chtml" ("compiled HTML") as phpCMS suffix, as opposed to "*.html" for "normal" HTML pages etc.
[edit] Separate directory
On could group all the files one wants to "hide" from the parser into a separate directory, and include in that directory a .htaccess file with the following single line as content:
AddType text/html .html
That tells "Apache" not to send the "*.html" files in that directory and all its subdirectories to the parser.
[edit] Remarks
- It is recommended to use different suffixes for static HTML and phpCMS content files anyway in order to be able to more easily distinguish between phpCMS-adapted HTML files and "normal" (static) HTML files.
- If one is troubleshooting the website and encounters the effect that some pages are not parsed, one of the methods above, applied "by accident", could be the reason. - "It's not a bug, it's a feature."
(Collected from different threads in the phpCMS support forum)
Main Page: Tutorials MainPage | Top Page: MiniHowTos MainPage
Diese Seite in anderen Sprachen: Deutsch

