Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Shorter Profile Url
CallieJo's Avatar
CallieJo
Join Date: May 2004
Posts: 85

 

Snowville
Show Printable Version Email this Page Subscription
CallieJo CallieJo is offline 12-22-2007, 10:00 PM

What does it do?
It produces a short profile url like so: yourdomain.com/username

Do you guarantee it will work on my server?
No.

Will you support this if I cannot get it to work for me?
I cannot guarantee this will work for everyone and therefor I will not support this.

Will this work with usernames that have special characters or spaces in them?
I don't know. I have only tested it on my test forum with a few usernames that don't have special characters or spaces in them. If it works for you, please let others know.

How can I tell my members about the shorter profile url?
That is something you will need to figure out.
Or view my update post here to show it in their profiles: https://vborg.vbsupport.ru/showthrea...46#post1435246

If this does not work for me, can you suggest another one?
VBseo
Zoints
Nuhit.com

Insert the following code in your .htaccess file (You might want to read the whole thread for other code examples that might work best for you):
Code:
RewriteEngine on
RewriteRule ^/?([a-zA-Z0-9]+)$ member.php?username=$1 [L]

Credits/References:
SitePoint
Vbulletin.com Thread
Zamurick X
Apache Module mod_rewrite
Reply With Quote
  #12  
Old 12-26-2007, 11:38 AM
Shaliza Shaliza is offline
 
Join Date: Apr 2006
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice one. I'm going to try it. Much simpler than the other method that was posted.
Reply With Quote
  #13  
Old 12-26-2007, 09:15 PM
Zamurick X Zamurick X is offline
 
Join Date: Dec 2007
Location: Canada (BC)
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also does this regex support numbers? It appears it only supports a-z as the first character of the user name.

Try changing it to:
Code:
RewriteEngine on
RewriteRule ^/?([a-zA-Z0-9]+)$ member.php?username=$1 [L]
Although I'm not sure if it already does support all cases as well as numbers. Just a suggestion. Once again, thank you.
Reply With Quote
  #14  
Old 12-29-2007, 04:59 PM
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Location: Snowville
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zamurick X View Post
Also does this regex support numbers? It appears it only supports a-z as the first character of the user name.

Try changing it to:
Code:
RewriteEngine on
RewriteRule ^/?([a-zA-Z0-9]+)$ member.php?username=$1 [L]
Although I'm not sure if it already does support all cases as well as numbers. Just a suggestion. Once again, thank you.
Great suggestion! Thanks for helping out I've updated the article to reflect your suggestion.
Reply With Quote
  #15  
Old 02-03-2008, 10:48 AM
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Location: Snowville
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the code I'm currently using (I have other stuff in it but this will pertain to this article):
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^$ index.php
RewriteRule (^[-_A-Za-z0-9\ ]*$) member.php?&username=$1
I just wanted to make note that you must use a trailing slash at the end of your links to directories or you will get an error message saying that user does not exist. For example, if you have a gallery and you link to it like yoursite.com/gallery then you will need to change the url in your navigation to yoursite.com/gallery/ so the mod rewrite doesn't treat it like a username. Check your navigation to all areas of your site once you've used the mod rewrite code.

If you are using 3.7.0 beta 4 and want to change the url in member profiles to reflect their new profile url so they know what it is...

Edit the template "memberinfo_block_contactinfo" and find this code:
Code:
<dd><a href="$prepared[profileurl]">$prepared[profileurl]</a></dd>
and change it to:
Code:
<dd><a href="http://www.yoursite.com/$userinfo[username]">http://www.yoursite.com/$userinfo[username]</a></dd>
You will need to change yoursite.com to that of your forum. So if your forum is yoursite.net/forum or forums.yoursite.org or whatever, then be sure to change it as so.
Reply With Quote
  #16  
Old 02-21-2008, 03:52 AM
cfitzarl cfitzarl is offline
 
Join Date: May 2007
Location: Boston, MA, USA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would suggest using:

RewriteEngine on
RewriteRule ^(.*)/?$ member.php?username=$1 [L]

When you have (.*), that can stand for any letter, number, or symbol.
Reply With Quote
  #17  
Old 03-03-2008, 03:57 PM
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Location: Snowville
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cfitzarl View Post
I would suggest using:

RewriteEngine on
RewriteRule ^(.*)/?$ member.php?username=$1 [L]

When you have (.*), that can stand for any letter, number, or symbol.
Thank you for contributing. Much appreciated.
Reply With Quote
  #18  
Old 03-08-2008, 04:15 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works for most people on my forum, but not for any with special characters in their name, like myself. Any way to fix this?
Reply With Quote
  #19  
Old 05-24-2008, 05:44 AM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cheat-master30 View Post
This works for most people on my forum, but not for any with special characters in their name, like myself. Any way to fix this?
Anyone know how to fix this issue?
Reply With Quote
  #20  
Old 05-31-2008, 07:57 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do, because one of the supporters of this, Zamurick, actually fixed the problem for me. I'll ask if it can be posted here.
Reply With Quote
  #21  
Old 05-31-2008, 09:00 PM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cheat-master30 View Post
I do, because one of the supporters of this, Zamurick, actually fixed the problem for me. I'll ask if it can be posted here.
Great, I hope so... It should be a simple fix from my understanding, though I have no idea how to do it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05431 seconds
  • Memory Usage 2,310KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete