2
I’m having a hard time creating an alternative, more user-friendly URL for my customers.
The real estate system I have generates an alternative address for each of them, example: http://foo.bar/site.php?id=1042
However, I need the URL to be more user-friendly, that is, simple to memorize. Thinking about it I generated in the system the creation of URL for the type clients http://foo.bar/gladisonimoveis
But in this case, what I’d like is when you type http://foo.bar/gladisonimoveis
was directed to http://foo.bar/site.php?id=1042
only it gives error 404, because there is a directory /gladisonimoveis only that creating a directory for each client is something very exhaustive.
A fellow programmer of mine said I can standardize this by once configuring in htaccess.
I’m waiting for help, please. Rss
There is a resource called
routing
where you present user-friendly Urls and they are redirected to specific controllers in your application, this feature is usually available in MVC frameworks. You can search forPHP routing
and see how to implement this manually if your case.– Edson Horacio Junior
@Edsonhoraciojunior will do a search yes, thank you!
– Gladison Neuza Perosini
You can do this with htaccess yes. Do you work with Slug on the project? You can’t pass gladisonimoveis and know that it is id 1042, da para vc passar o gladisonimoveis e pesquisar por quem tem esse Slug, or then pass id after Slug, it would be gladisonimoveis/1042, but it would be better to pass this encrypted id.
– André Vicente