

Ask HN: How to Create Vanity URLs in PHP - hardik988

Hi, I'm looking to create Vanity URLs for every user on my website (in PHP), like xyz.com/userone - which will host his profile. Editing may or may not be on the vanity URL. 
Any ideas/tips/resources on how do I o about doing this ?
======
slater
Start with GET variables, eg. example.com/?bla/something/whatever

Use a .htaccess file to re-route every 404-resulting request (eg
xyz.com/bla/something/ doesn't really exist) to index.php, then you can
explode() the $_GET variable (look at what $_SERVER outputs).

------
auston
are you using a framework? usually comes built in with most php frameworks.

