r/PHPhelp • • Mar 06 '14

How to customize URL [PHP]

How can I rewrite URL for user profiles to show their name instead of their id.

What it shows currently:

What I want to show:

What is the best way to accomplish this.

9 Upvotes

4 comments sorted by

4

u/samyel Mar 06 '14

The short answer is mod_rewrite for apache and nginx's http rewrite module.

The longer, more complete answer is PHP Routing. Googling this would help you understand more about it, at a quick search this stackoverflow answer might help you.

Personally, I quite like dispatch.

2

u/change_theworld Mar 06 '14

thank you.

1

u/gwevidence Mar 06 '14

Tutsplus had a writeup on mod_rewrite.

2

u/change_theworld Mar 07 '14

thts a very lucid yet comprehensive guide for my skill level. thank you for that.