Re: Dynamic PHP Home Page
| From: | Matthew Kendall | Date: | Mon, 10 Jul 2000 01:57:53 +0000 |
| Subject: | Re: Dynamic PHP Home Page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5667@lists.php.net to get a copy of this message | ||
"Ray Street" <charay@ihug.co.nz> wrote...
> I need to have part of a site's home page dynamic
> (the "Last Changed" date).
>
> The way I see it can be done is to have the index.html page
> call an index.php3 file using the meta refresh tag. So basically
> the index.html page is empty and all it does it start the php3 script.
>
> Is this the best way to do it?
There are two approaches to addressing your problem which, reading between
the lines, seems to be "how can I get PHP to parse the default index page,
index.html".
o The default page does not have to be index.html
o PHP-parsed files do not have to have the .php extension
To use the first approach, configure your web server to look for index.php
instead of, or as well as, index.html, when finding a default page. For
Apache, use something like this in httpd.conf or a .htaccess file:
DirectoryIndex index.php index.htm index.html
To use the second approach, configure your web server to use PHP to parse
all pages, not just those with .php extensions. For Apache, use something
like this:
AddHandler application/x-httpd-php php php3 html htm
Also, I suggest you do not expose the file extensions to the world in your
URLs. Instead of using URLs like http://www.mysite.com/foo.php use
http://www.mysite.com/foo and let the web server figure out
that foo.php is
the correct file to serve. This way you can change to a different technology
(and associated filename extension) without breaking inbound links. For
Apache, use:
Options +MultiViews