aalaap
aalaap

Reputation: 4411

How do I set up WordPress at the root but still use /username URLs?

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:

http://website.com/

http://website.com/about

http://website.com/blog

In addition to the default blog URLs, I also want to provide username URLS such as:

http://website.com/username

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?

Upvotes: 1

Views: 52

Answers (1)

Babak Naffas
Babak Naffas

Reputation: 12571

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.

Upvotes: 0

Related Questions