Bug #67645 [Opn->Csd]: routes with dots (e.i /v2.1/ ) are not recognized

From: Date: Wed, 23 Jul 2014 14:54:06 +0000
Subject: Bug #67645 [Opn->Csd]: routes with dots (e.i /v2.1/ ) are not recognized
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186785@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67645&edit=1 ID: 67645 User updated by: genesislive2007 at gmail dot com Reported by: genesislive2007 at gmail dot com Summary: routes with dots (e.i /v2.1/ ) are not recognized -Status: Open +Status: Closed Type: Bug Package: Built-in web server Operating System: OS X PHP Version: 5.4Git-2014-07-17 (snap) Block user comment: N Private report: N New Comment: Duplicate but https://bugs.php.net/bug.php?id=67671 Previous Comments: ------------------------------------------------------------------------ [2014-07-23 14:52:25] genesislive2007 at gmail dot com Yea! It seems the same bug (https://bugs.php.net/bug.php?id=67671) I'll close this ------------------------------------------------------------------------ [2014-07-23 14:29:45] tobias at twokings dot nl This may be completely unrelated to filenames; I'm seeing a similar problem with dots in request URI's when rewriting everything to /index.php (see also https://bugs.php.net/bug.php?id=67671, containing another example). Not sure if this is the same issue; if it is, feel free to delete / merge mine. ------------------------------------------------------------------------ [2014-07-17 18:59:14] requinix@php.net 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. ------------------------------------------------------------------------ [2014-07-17 17:38:14] genesislive2007 at gmail dot com typo ------------------------------------------------------------------------ [2014-07-17 17:28:11] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67645&edit=1

« previous php.bugs (#186785) next »