On a WordPress based site, I'm trying to do something like Twitter or Facebook's username URL suffix. Member URLs would be something like:
domain.com/username
However, we also have custom pages that are hosted on the same domain root. Example of the URLs are:
domain.com/contact
domain.com/support
domain.com/register
domain.com/login
I have considered adding custom rules for each user by binding WordPress' WP_Rewrite to the user_register
action but I learned that this would be stored in the options
table under the rewrite_rules
column, the value of which is stored in longtext
. I'm concerned with the scalability of this approach and possible drawbacks against future DB performance.
Basically, we first have to check if the request made is of a valid existing username, and if not, check if it's a valid WordPress post or page, and if not, redirect to the 404 page.
Note that we don't want our own pages to have a prefix ( e.g. domain.com/p/contact ).
How do I go about solving this one?
Thank you very much.