Skip to content

Commit

Permalink
also need to get rid of script name path in case we use htaccess file
Browse files Browse the repository at this point in the history
for example htaccess file like this:
```
RewriteRule ^api/(v[0-9]+)/((?!index\.php$).+)$ api/$1/index.php [L,NC]
```
  • Loading branch information
DarkSide666 committed Jan 9, 2019
1 parent 51b2089 commit 5956293
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($request = null)
$script = $_SERVER['SCRIPT_NAME'];
$path = $_SERVER['REQUEST_URI'];

$this->path = str_replace($script, '', $path);
$this->path = str_replace(dirname($script), '', str_replace($script, '', $path));
}

$ct = $this->request->getHeader('Content-Type');
Expand Down

0 comments on commit 5956293

Please sign in to comment.