| |||||||||||
| |||||||||||
.php or .html extension? Morally Static Pages
You'll find many pages on our web site with .php extensions, and many more with .html extensions. "So the .php files contain executable content and the .html files do not" you may think. No - not exactly; in practise almost every page actually contains some PHP / Script elements. So WHAT, WHY, HOW?
WHAT ... All pages which contain data which is essentially unchanging have extensions that end in .html, but pages which are essentially dynamic are classified as .php. I describe the pages that are unchanging as Morally Static Pages, and examples might include /share/prisonbridge.html and /mouth/17_Differing-tastes.html, both of which are generated from databases; in essence they don't ever change a great deal unless I modify the content, but you will see small changes from time to time in the list of nearby places on the Prison Bridge page, or in the "see also" column of the Differing Tastes page. We have a number of truly dynamic pages. For example our Site Map Page will change to give you a site map relative to your current location each time you call it up, and our Image Library Search will vary depending on what pictures have recently been added and what you're searching for. WHY ... If you are looking for a page, then you'll feel confident that a .html file is one that you can bookmark, come back to - a simple soul that's going to vary little and you can rely on to stay the same until the site owner changes it. By contrast, if you find a page that's saying that it's dynamic, it probably is and you'll treat it with a degree more respect. You may bookmark it, but you'll be aware that results may change rather more frequently, and you'll treat it with rather more circumspection. The same thing applies to the best search engine crawlers, I think. In amongst all the various factors they take into account, they'll look at how often a page changes / is likely to change and the extension offers a good clue. So the application of different extensions is an aid to them as they're indexing your page too, helping them to categorise as appropriate. HOW ... We're using the .htaccess file and Apache httpd's mod_rewrite to provide the facilities that we need. At the very simplest, a line such as AddType application/x-httpd-php .htmladded to the httpd.conf (or appropriate .htaccess) file(s) will trigger the web server to parse all .html files in case they contain PHP. In a more extreme case, a directive such as RewriteRule ^(.*)\.htm /share/index.php?pagename=$1will take all .html and .htm requests and divert them to index.php, with a parameter called pagename being passed in. This is the basis under which a whole directory of Morally Static Pages can be generated on the run, without there being a single truly static page present at all. (written 2007-09-17 19:07:09) Associated topics are indexed under H112 - PHP - Further Web Page and Network HandlingA603 - Web Application Deployment - Further httpd Configuration W603 - Web and Intranet - Server Side Technologies
Some other Articles
Little Gems but not LettuceLook forward with a new broom - Wiltshire Train Service Clean my plate, but keep my wine bottle. (PHP; Static) Crystal Ball - How long do I need to be online? .php or .html extension? Morally Static Pages Match the Bedroom to the Hotel Mood shots Actionscript / Flash / Flex (IAQ/FAQ) Compressing web pages sent out from server. Is it worth it? FSB (Federation of Small Businesses) Western Region 1638 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||