Bug #75583 [Com]: .html file extension ignored by the built-in server

From: Date: Tue, 23 Jan 2018 03:24:37 +0000
Subject: Bug #75583 [Com]: .html file extension ignored by the built-in server
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213672@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75583&edit=1

 ID:                 75583
 Comment by:         mattficken@php.net
 Reported by:        marco dot moura at fatec dot sp dot gov dot br
 Summary:            .html file extension ignored by the built-in server
 Status:             Verified
 Type:               Bug
 Package:            Built-in web server
 Operating System:   Windows
 PHP Version:        7.1.12
 Block user comment: N
 Private report:     N

 New Comment:

So you request /index.html and index.html exists but you get a 404 error? or the mime type is wrong?

Please confirm/clarify and I will continue investigating.

I just did a quick check of requests for / /index.htm /index.html and they were returned and the
mime-type was returned(text/html). This worked for me on 7.0 and 7.1.5.

The mime_types are registered in mime_type_map.h.

php_cli_server_request_translate_vpath() looks like it should work for both .htm and .html... it
just that a request for / will return index.html or index.php but NOT index.htm (as designed).


Previous Comments:
------------------------------------------------------------------------
[2017-11-28 17:17:07] cmb@php.net

Indeed, while .htm is supported, .html is not, although the
documentation claims support for .html[1].

[1] <www.php.net/manual/en/features.commandline.webserver.php>

------------------------------------------------------------------------
[2017-11-28 00:14:42] marco dot moura at fatec dot sp dot gov dot br

Description:
------------
When running php -S localhost:8000, or any chosen port number, html files can't be found by the
built-in web server. For instance, after creating a folder, adding an index.html file, serving the
folder, and accessing it through the web browser, the following error is returned: "The
requested resource /index.html was not found on this server". This doesn't happen with
.php files though. Tested using PHP version 7.1.12 x64, both Thread-Safe and Non Thread-Safe.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75583&edit=1


Thread (5 messages)

« previous php.bugs (#213672) next »