| Author |
Can php pages be named html and still be parsed
|
|
|
| I am sure I heard that recent browsers can process the PHP script on a page
with the html extension...Is this true?
| |
| Steve Fleischer 2004-02-29, 9:28 am |
| On Sun, 29 Feb 2004 00:02:07 +1100, ACAY wrote:
> I am sure I heard that recent browsers can process the PHP script on a page
> with the html extension...Is this true?
Apache can be made to do this using the AddType directive. However, your
host would probably not want to do this due to the increased server
loading.
--
Steve
www dot flyingtigerwebdesign dot com
Hong Kong, 29-Feb-04 9:04:18 PM
| |
|
|
| Gary White 2004-02-29, 11:28 am |
| "ACAY" <kakotamaya2001@hotmail.com> wrote in message
news:c1sns2$1sn$1@forums.macromedia.com...
> I am sure I heard that recent browsers can process the PHP script on a
page
> with the html extension...Is this true?
Steve and Alexandru have given you good advice. I might just add that the
*browser* has nothing to do with it. The browser never sees PHP code. The
PHP is executed by the server and only plain HTML is sent to the browser.
Gary
| |
| Michael Fesser 2004-02-29, 1:28 pm |
| .oO(ACAY)
>I am sure I heard that recent browsers can process the PHP script on a page
>with the html extension...Is this true?
It's a server-issue, the browser doesn't matter.
A third solution (I use this one) for Apache servers:
Give the files two extension like 'filename.html.php' and use content
negotiation (MultiViews in this case). The server will find the files
even if they are accessed without the '.php'.
Micha
| |
| Michael Fesser 2004-02-29, 1:28 pm |
| .oO(Steve Fleischer)
>Apache can be made to do this using the AddType directive. However, your
>host would probably not want to do this due to the increased server
>loading.
IMHO there should be no increased load with this method, there's no
difference in how the files are processed (except for reading one more
line from the .htaccess-file).
Increased load could be an issue when using negotiation or mod_rewrite,
but nevertheless I use them both because they make life easier. ;)
Micha
| |
| Gary White 2004-02-29, 2:28 pm |
| "Michael Fesser" <netizen@gmx.net> wrote in message
news:te7440h6heu96u1ok784srl8qptrgt50ma@4ax.com...
>
> IMHO there should be no increased load with this method, there's no
> difference in how the files are processed (except for reading one more
> line from the .htaccess-file).
>
> Increased load could be an issue when using negotiation or mod_rewrite,
> but nevertheless I use them both because they make life easier. ;)
But what they're talking about is processing ALL html pages as PHP. That is
the part that would produce additional server load.
Gary
| |
| Alan Ames 2004-02-29, 3:28 pm |
|
> But what they're talking about is processing ALL html pages as PHP. That is
> the part that would produce additional server load.
If it's a 1000 page static html site, with 2 PHP pages, AND the server was
setup to parse .html as php; then yes- it's causing slight load to parse all
pages because they don't want to use the .php file extension on the two
pages that need to be parsed.
If the site is all or almost all PHP anyway- setting it up so it can use
..html or friendly shorter urls won't be much additional problem, and may be
worth it in some obscure search engine minutiae.
| |
| Jason Dalgarno 2004-03-01, 6:28 am |
| Michael Fesser <netizen@gmx.net> wrote in
news:b87440du8vo8hhh2acr4hg1ebmeth48039@4ax.com:
> A third solution (I use this one) for Apache servers:
>
> Give the files two extension like 'filename.html.php' and use content
> negotiation (MultiViews in this case). The server will find the files
> even if they are accessed without the '.php'.
Only if the browser sends */* in the accept header.
GET /foo.html HTTP/1.1
Host: localhost
Accept: text/html
HTTP/1.1 406 Not Acceptable
Date: Mon, 01 Mar 2004 09:55:47 GMT
Server: Apache/1.3.29 (Win32) PHP/4.3.4
Alternates: {"foo.html.php" 1 {type application/x-httpd-php}}
Vary: negotiate
TCN: list
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |