I have a website that uses this style: /index.php?page=45&info=whatever&anotherparam=2
I plan to have a pretty url to convert the previous url to: /profile/whatever/2
I know that I need to use .htAccess and redirect everything to index.php. It's great.
My problem is more with index.php (Front Controller). How can I recover $_GET["info"]and $_GET["anotherparam"]continue to use all existing code that I use $_GET[...]on my page?
Do I need to create a GET in the header with some code, or do I need to get rid of everything $_GET[...]on all pages by creating my own array that will parse ever /and assign something like: instead of $myParam["info"] = "whatever"using the page $myParam[]instead $_GET[]?
I would not want to change all pages using $_GET[]
Edit:
My .htAccess looks like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ index.php [NC,L]
Everything that does not exist goes to index.php. Since I already use this structure: /index.php?page=45&info=whatever&anotherparam=2nothing is broken. But now I will use it /profile/whatever/2, and in the case of the switch, I can determine which page include(..), but the problem is with all the GET parameters. How to create them for access from the whole page using $ _GET []?
source
share