I want to remove index.php
from my URL after Query Params.
This is My Url:
http://127.0.0.1/user/report?user=USERNAME
I have removed Query Params and convert it into Pretty Url using:
RewriteCond %{QUERY_STRING} !user=
RewriteRule ^([a-zA-Z0-9\-]+)/(.*)$ $2?user=$1 [L,QSA]
RewriteRule ^([a-zA-Z0-9\-]+)$ ?user=$1 [L,QSA]
Now, My URL looks like this:
http://127.0.0.1/user/report/USERNAME
So all the requests to this URL will point to the entry script of my project i.e. web/index.php
.
When I use below routes to get data, it works:
http://127.0.0.1/user/report/Default/index.php/api/registration/user-registrations/
But when I remove index.php
from URL and access it like below, it throws 404.
http://127.0.0.1/user/report/Default/api/registration/user-registrations/
FYI, I am using Symfony for routing all my routes.
I am stuck in this from the past 2 weeks. Please help.