Re: Using PHP on an .html file
| From: | Curt Zirzow | Date: | Mon, 25 Aug 2003 01:42:43 +0000 |
| Subject: | Re: Using PHP on an .html file | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160623@lists.php.net to get a copy of this message | ||
* Thus wrote Mike Migurski (mike@saturn5.com):
> >> Better to do this in an .htaccess file, so you don't incur PHP
> >> processing overhead on the entire server (if there are others using
> >> it).
> >
> >Apache suggests not using .htaccess files at all because they require a
> >recursive traversing of directories looking for .htaccess files, because
> >some supersede others or something like that.
>
> The only way to eliminate the overhead of searching for .htaccess files is
> to set the Allowoverride directive to 'None' in your httpd.conf file -
> otherwise, they will be checked for on every request whether they exist or
> not. The question is: does the additional benefit of using per-directory
> configuration and selective .html-as-.php handling outweigh the speed gain
> of not looking for .htaccess files? This depends on the server, how it's
> used, and how important raw performance is vs. ease of use.
I believe the only time it become a perfomance issue is when you
have a complex sub directory structure:
http://host/dir1/dir2/dir3/dir4
apache will look at each directory (dirX) and apply .htaccess rules
overriding each dir from from document root.
>
> Just to quickly return to the original question, I would not use either
> method - instead I would turn multiviews on, and not use file extensions
> in URL's at all.
>
> http://httpd.apache.org/docs/content-negotiation.html
This is very interesting and I'm surprized I've overlooked this
option. Unfortantly, apache doesn't provide a good example of what
this actaully does. A Quick google search didn't result in too good
of results. Do you have any other references on how this
'multiview' option work?
Thanks,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."