I want to short my url

I’m using this code for generate link
href=“single.php?directory={$row[‘id’]}”

Result

http://localhost/findlocalmap/single.php?directory=51

But i want to change it. I want this type of link

http://localhost/findlocalmap/business-name

how can i do that please help me

It would be an htaccess rewrite rule, but I am not sure what the code would be.

This might help you, but based on what you want, it will be more difficult.

https://www.generateit.net/mod-rewrite/index.php

It generates:
RewriteEngine On
RewriteRule ^([^/]*).html$ /findlocalmap/single.php?directory=$1 [L]

Sponsor our Newsletter | Privacy Policy | Terms of Service