PDA

View Full Version : http://www.myforum.com/username -> Profiles (working but needs improvement)


Majidm
10-16-2006, 01:03 PM
Ok so I've got a way to make http://www.myforum.com/username go directly to a member's vBulletin profile, but I am looking for some help to make it better.

I'm using apache and .htaccess to make the myforum.com/username ReWrite to a custom php script /private_url.php?u=Username which then reverse fetches the userID from the username and uses Header redirection to take them to the profile page.

.htaccess

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^$ index.php
RewriteRule (^[-_A-Za-z0-9\ ]*$) /private_url.php?&u=$1


It works great, but the problem is with users who have Spaces in their name... ie http://www.myforum.com/User Name --- it's not practical for people making links to their profile.

What I want to do is convert Periods to Spaces... ie: http://www.myforum.com/User.Name goes to the user "User Name"

I'm just not sure how/if this is do-able, I believe I need a better RewriteRule. If someone could help me do this, I will release the scripts as a vBulletin mod.

Majidm
07-22-2010, 08:03 PM
Bumping this request up...

BirdOPrey5
07-22-2010, 11:42 PM
But what if there was a user "Bob.Smith" and "Bob Smith"? Both would be valid usernames?