Re: naming file
| From: | php3 at developersdesk dot com | Date: | Thu, 22 Jun 2000 11:34:32 +0000 |
| Subject: | Re: naming file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2612@lists.php.net to get a copy of this message | ||
Addressed to: "yat" <yat@usa.net>
php-general@lists.php.net
** Reply to note from "yat" <yat@usa.net> Thu, 22 Jun 2000 15:10:56 +0800
>
> another question on this topic, can i put both html into php and SSI
> at the same time..?
>
> That is
>
> AddType application/x-httpd-php3 .php3 .phtml .html & AddType
> text/html .shtml .html AddHandler server-parsed .shtml .html at the
> same time..
>
> i have tried but fail.. only run php. Is this correct?
>
No it will not work. You only get one server method for each file
extension. I believe you will find that Apache always uses the first
mime type it finds in the config files for an extension.
I think the best way to handle it is to make .shtml go thru SSI, .php
go thru php and .html go thru the normal apache process; then use the
extension to control how a particular file is processed. That is how
Apache is set up to work. Why fight it?
The only unusual thing I ever do is make .html go thru SSI on some
sites that use <#--include virtual="some_file.html"--> on every page.
As far as hiding php code behind .html, I'm proud to show the world
that my programs are PHP! Rasmus and others have assured me that
search engines accept .php as well as they accept .html, and I've
certainly seen no evidence that shows they are wrong.
There is nothing you can do with SSI that cannot be duplicated within
php. Since I started using php, I haven't used SSI for anything in new
sites. In fact, I haven't used much .html either. Even simple pages
have something in them that makes it desirable to keep it all php.
One common example...
(C) 1998-<?=date( 'Y' )?> Internet Marketing Specialists
Now I don't have to update the copyright date on pages, it always shows
the current year.
(C) 1998-2000 Internet Marketing Specilists
This ends up at the bottom of almost every page we create, and could be
done in SSI, but then I would have to maintain two different ways of
doing the same thing.
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com