Just a quick question,
I am making user profiles for my website and would like to include vanity URLS, but the page has a lot of separate information which gets loaded, e.g Followers tab, uploads tab, and each of these have some kind of setting that can be applied like ASC DESC, New/old results etc. What would be the best way to have vanity urls but keep the functionality i require?
http://www.site.com/user.php?id=1&content=Followers&Order=(Different settings for each result)
But i am wondering if it would be better if i should just name the content differently if someone wanted to search for followers + a limitation, for example
http://www.site.com/user.php?id=1&content=NewestFollowers,
rather than
http://www.site.com/user.php?id=1&content=Followers&Order=Newest
You typically want to construct the vanity URL so that it directly maps to query string parameters to the ugly URL. So if you have:
You can make your vanity URL look like:
But the
/1/bit is a little ugly, and not exactly vanity, so if you can pass a username through that query string parameter, it would look better:Then you’d just put some mod_rewrite rules in an htaccess file in your document root that internally rewrites the vanity URL back to the ugly one: