0

Let's suppose i have a website (example.com/index.php) which displays a list of products. Now if i want to open and see full details about a specific product in its own page, i would normally create another directory like example.com/product/index.php?id=the-id-of-some-product How can i display a cetain product with the following url example.com/index.php?id=the-id-of-some-product What i want to create in the end is the following url: example.com/the-name-of-some-product

i tried to display details about a certain product without creating extra folders. So instead of this example.com/product/index.php?id=the-id-of-some-product I wanted this example.com/index.php?id=the-id-of-some-product

  • The basics of URL rewriting you can find explained under https://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained – CBroe Feb 16 '23 at 11:44
  • _"What i want to create in the end is the following url: example.com/the-name-of-some-product"_ - if you want to use the name instead of an ID, then you will need to modify your script logic that selects the relevant record from the database as well. (The only other option would be to hard-code every single name -> id combination in your rewrite configuration, and that would not be a good idea.) – CBroe Feb 16 '23 at 11:45

0 Answers0