I have a PHP project where the page URL-s have the following format:
item.php?productid=7816
about.php?pageid=2
Is it possible to bring those URL-s to a more user friendly format like this:
items/item_name [or page title]
pages/page_name [or page title]
I know that I can do that with mod_rewrite but have no clues how to do that, how to replace the parameters, etc. with a text.
Any help would be greatly appreciated.
Thanks.
In your .htaccess
then add
Where Pattern can be any Regex Pattern to match. In Destination you can use Capture Groups from the Pattern. i.e.
Where “$1” is what was matched in the parentheses “([0-9]+)”
then I would rewrite your scripts to accept names instead of ids.