If you're using Apache you can do this with mod_rewrite. You can learn more about here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html
The example rule would be:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /?page=$1&cat=$2 [L]
well he means he don't know as to capture the $_GET values of www.example.com/category/Pizzas in php source code.
this is all done with apache mod rewrite or nginx:
on your index.php page you can define it:
<?php
if (isset($_GET['page']) && isset($_GET['cat'])) {
$page = $_GET['page']; // category
$cat = $_GET['cat']; // Pizzas
// From here you can start using both strings
}
?>
php will get this:
www.example.com/index.php?page=category&cat=Pizzas
and user will see www.example.com/category/Pizzas on URL (thanks to mod rewrite):
RewriteEngine on
RewriteBase /
RewriteRule ^category/(.*)$ index.php?page=category&cat=$1 [L]
In that repo, take a look in public/.htaccess This is where the magic happens. It's the web server which actually does the job of mapping the url to parameters. The code looks like this:
RewriteEngine on
RewriteBase /
RewriteRule ^category/(.*)$ index.php?page=category&cat=$1 [L]
What that's doing is saying any url that looks like category/ will be rewritten to index.php?page=category&cat=
So index.php actually handles all those requests, and has the correct GET value - even though the url used is different.