I have a shop page that contains all products from the database.
Upon clicking on any product it will take the user to the "product" page along with the product name through the URL using ?/xox_product_name
so the href of each product on the shop page goes like
product?/xox_product_name
And on the product page, I use the below code to extract the product title
$end = array_slice(explode('/', $url), -1)[0];
Which works fine. But my client told me to lose the ?
which is the issue.
On removing the "?" the href gonna be like 'product/xox_product_name' which actually searches for a folder name 'xox_product_name' and returns to 404 page.
How do I make the href go to the product page along with the product name without the ?
in the URL
Any help is appreciated.