-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Hi!
I tested the master branch today and there is actually a major beaking change (to me).
I added a .htacess file on my root folder in order to redirect everything to index.php (the API):
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
</IfModule>Like this, the root folder is my API and I can have clean URLs like this: https://example.com/records/something.
It seems that this method is causing the trouble because it removes everything from request path:
Middleware/Router/SimpleRouter.php
private function removeBasePath(ServerRequestInterface $request): ServerRequestInterface
{
$path = $request->getUri()->getPath();
if (substr($path, 0, strlen($this->basePath)) == $this->basePath) {
$path = substr($path, strlen($this->basePath));
$request = $request->withUri($request->getUri()->withPath($path));
}
return $request;
}I can't think of a way to enable again this feature because I don't see what it can break.
I just know it worked with the version actually on my fork:
https://github.com/sebj54/php-crud-api.
I don't know if I am the only one in this case, but I cannot update because it will break all my routes.
Thanks for your help!