0

I have a url like:- <a href="category.php?category=<?php echo $categry_slug ?>"></a>

I want to make it like <a href="category.php/<?php echo $category_slug ?>"></a>

this is what i have tried <a href="category.php/<?php echo $category_slug ?>"></a> this is what i want

and how will retrieve the categry_slug from the url on categry page which displays the products of the category please can anyone help? The products are displayed using the get method

  • 4
    If you use Apache as a web server then you can do this through [a .htaccess rewrite rule](https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html). Are you using Apache? – KIKO Software Aug 03 '23 at 08:58
  • 1
    You can try to learn any PHP frameworks such as Laravel or Slim4 for lightweight. These frameworks handle url pattern perfectly. Else, url rewriting is your choice. – Eng Cy Aug 03 '23 at 09:06

0 Answers0