How do I remove .php
and replace ?
with /
at the same time.
I have
http://localhost/testingproject/testing.php?mode=getdata
I want it to be called from the browser like this:
http://localhost/testingproject/testing/getdata
In replacing ?
data, I want it to be compatible with dir.
Like in dir, I have:
testing.php
user.php
dashboard.php
So, if the user calls http://localhost/testingproject/user
, alone, there is no need to parse ?
to /
as user
is a valid PHP file: user.php
.
But if user the calls http://localhost/testingproject/user/abc
, then user.php
page should get $_GET['mode']
value abc
.
I've searched but still cannot find compatible htaccess code.