I want to short my url


#1

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


#2

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


#3

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]