I’m setting up a website using WordPress as the main CMS. There will be lots of static pages and a blog. URLs will be:
In addition to the default blog URLs, I also want to provide username URLS such as:
Note: These usernames have nothing to do with the WordPress blog usernames. They will be from another database.
I’m thinking of setting up the WordPress 404.php handler to consider /whatever
as usernames, because WordPress will not have handled them (which means they’re probably usernames). In case the query string is /whatever/something/else
, I’ll display a regular 404 message, because that probably wasn’t a username request.
Is this a good, acceptable way to work this out or should I be modifying the .htaccess
to route stuff given up by WordPress into an independent /user.php?username=whatever
? Is there any other way to get this done?
What about using http://www.example.com/users/whatever as the URL for the user pages? The /users/ will give you a unique URL by which to identify the user pages.
This URL format could then be redirected to /user.php?username=whatever as per your example.