php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67645 routes with dots (e.i /v2.1/ ) are not recognized
Submitted: 2014-07-17 17:28 UTC Modified: 2014-07-23 14:54 UTC
From: genesislive2007 at gmail dot com Assigned:
Status: Closed Package: Built-in web server
PHP Version: 5.4Git-2014-07-17 (snap) OS: OS X
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: genesislive2007 at gmail dot com
New email:
PHP Version: OS:

 

 [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.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-17 17:38 UTC] genesislive2007 at gmail dot com
-Summary: routes with dots (e.i /v2.1/ ) are not decognized +Summary: routes with dots (e.i /v2.1/ ) are not recognized
 [2014-07-17 17:38 UTC] genesislive2007 at gmail dot com
typo
 [2014-07-17 18:59 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2014-07-17 18:59 UTC] 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-23 14:29 UTC] 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-23 14:52 UTC] genesislive2007 at gmail dot com
-Status: Feedback +Status: Open
 [2014-07-23 14:52 UTC] 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:54 UTC] genesislive2007 at gmail dot com
-Status: Open +Status: Closed
 [2014-07-23 14:54 UTC] genesislive2007 at gmail dot com
Duplicate but
https://bugs.php.net/bug.php?id=67671
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC