|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-07-17 17:28 UTC] genesislive2007 at gmail dot com
Description: ------------ Using the php as webserver, the request to a route in witch there is one or more dots fails. For example the route I've used is http://127.0.0.1:8000/v2.1/ The response is "The requested resource /v2.1/ was not found on this server." I suppose php looks for a phisic resource, infact if a file stored into a subdir named v2.1 in the webroot, the response is positive. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 26 18:00:02 2025 UTC |
So if you rename the directory to something without a period, it starts working? With no other changes whatsoever? Because the built-in server does not do directory listings or use index files. You need a router script for that. You should use a router script anyways to reproduce the behaviors you'd get from your actual web server (URL rewriting being another prime example). <?php $file = $_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"]; if (is_dir($file) && is_file($file . "/index.php")) { include $file . "/index.php"; return true; } return false; ?> Using the above router script makes /v2.1 and /v2.1/ work for me on Windows.