I am creating a custom PHP MVC pattern from scratch. This is how my url looks like
http://domain.com/post/create
I could achieve this with the following htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+) index.php?controller=$1&action=$2 [L]
So, when I print my $_GET
, I am getting this
Array ( [controller] => post [action] => create )
Up to this is fine. But my issue is, if I have any extra parameter in query string, I am not able to get that.
ie. if I print $_GET
for http://domain.com/post/create?id=1
, I am not getting id
.
Any help would be greatly appreciated