I am creating a small e-commerce website. There we have a list of items which user can click and explore the information about the item. I am passing the item id and and some other information in the query string so on the next page I can get the related data from database.
Right now we have the following URL default structure:
www.somedomain.com/item.php?id=1&some1=somevalue&some2=somevalue
But I want the URL like:
www.somedomain.com/item/1/somevalue/somevalue
Where item
is item.php
and /1/somevalue/somevalue
is query string ?id=1&some1=somevalue&some2=somevalue
. I want my whole website query string parameters like above.
I am using core PHP, no framework. I did some with .htaccess
files but the server gives errors while loading the website. How can I do this with .htaccess
file?