I have a php function which detects $_SERVER["PATH_INFO"]
and then explodes all the params after index.php
. And all urls are rewritten using .htaccess
.
Here's the code for reference:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
The problem is my rewriting and my php function work fine locally, but on my test environment server, the function doesn't return $_SERVER["PATH_INFO"]
without having index.php
in my url.
For example:
if I go to example.com/index.php/this/is/a/test
, the function will give me an array like this: {this, is, a, test}
but if I go to example.com/this/is/a/test
rewrites to index.php
but my function gives me nothing.
I've already seen the answers here, but I think this is more of a server config issue. The server is current running on CentOS, with a OVH RELEASE 3 config (similar to cPanel, ISP Config). web packages are Apache2 and php5.
Appreciate any help coming this way. ✌️