Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Shorter Profile Url
CallieJo
Join Date: May 2004
Posts: 85

Snowville
by CallieJo CallieJo is offline 23 Dec 2007
Rating: (2 votes - 4.00 average)

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: http://www.vbulletin.org/forum/showt...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):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Credits/References:
SitePoint
Vbulletin.com Thread
Zamurick X
Apache Module mod_rewrite

Last edited by CallieJo; 03 Mar 2008 at 17:58..
Views: 18207
Reply With Quote
Comments
  #2  
Old 23 Dec 2007, 22:56
Zamurick X Zamurick X is offline
 
Join Date: Dec 2007
Real name: Chase
This is great. I would like to add that you may want to remove the "/" from the .htaccess mod_rewrite. That will allow users who have their forums in another directory to use this. Because if I were to put the .htaccess in my /forum/ directory, and I went to "www.w.xyz/forum/username", it would most likely give me a 404, saying that "www.w.xys/member.php" does not exist. Thanks for the modification.
Reply With Quote
  #3  
Old 23 Dec 2007, 23:51
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Originally Posted by Zamurick X View Post
This is great. I would like to add that you may want to remove the "/" from the .htaccess mod_rewrite. That will allow users who have their forums in another directory to use this. Because if I were to put the .htaccess in my /forum/ directory, and I went to "www.w.xyz/forum/username", it would most likely give me a 404, saying that "www.w.xys/member.php" does not exist. Thanks for the modification.
Thank you. I've updated the code to reflect your suggestion and another change I found on the Apache site.
Reply With Quote
  #4  
Old 24 Dec 2007, 00:53
hocphp hocphp is offline
 
Join Date: Nov 2007
i' ll downloading this mod for research and use
__________________
Vinarank
php community

Last edited by hocphp; 24 Dec 2007 at 02:09.
Reply With Quote
  #5  
Old 24 Dec 2007, 01:55
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Your welcome
Reply With Quote
  #6  
Old 24 Dec 2007, 02:40
aycan555 aycan555 is offline
 
Join Date: Dec 2005
Real name: www.ultrapaylasim.com
but we got the foregn alfabets like my board there is turkish caracters user name; like these

Ayse
Ayşe

now both users url are going to be same, i am currently using it with siteurl/userid-username
__________________
Reply With Quote
  #7  
Old 24 Dec 2007, 05:45
JawadIT JawadIT is offline
 
Join Date: Jan 2006
hello
thanks for the mod
but the thing is that i am not knowing how and where to put that code...so could you please give us a brief explanation

thanks again
Reply With Quote
  #8  
Old 24 Dec 2007, 11:33
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Not a modification, moved to articles section.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #9  
Old 24 Dec 2007, 19:41
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Originally Posted by JawadIT View Post
hello
thanks for the mod
but the thing is that i am not knowing how and where to put that code...so could you please give us a brief explanation

thanks again
Place the code provided into your .htaccess file. If you do not have that file in the root of your forum, here is how to create one:

Originally Posted by http://www.htmlite.com/HTA003.php
You don't need any special program or hardware to create an htaccess file. In fact, all you need is a regular, simple text editor such as Notepad.

Now the tricky part is saving the file. The htaccess file is a no-name filename with an eight letter extension.
".htaccess"

When you save files in a text editor, it will usually add a default extension to files, so you might end up with...
".htaccess.txt"

Here is how you fix this problem :
File
Save As...
In the FILE TYPE box, choose ALL FILES
In the FILE NAME box, type in ".htaccess"
And be sure you used quotes around the filename when you typed it in.

If that doesn't work, your FTP program should let you do a RENAME on a file to make it right.
--------------- Added 24 Dec 2007 at 19:41 ---------------

Originally Posted by Marco van Herwaarden View Post
Not a modification, moved to articles section.
Thank you. I wasn't sure where to place this.

Last edited by CallieJo; 24 Dec 2007 at 19:42. Reason: Auto-Merged DoublePost
Reply With Quote
  #10  
Old 25 Dec 2007, 16:13
vuiveclub vuiveclub is offline
 
Join Date: Jan 2007
How can I rewrite some unicode characters as " ă ạ ả ắ ầ " etc to "English character if I use this Rewrite?
__________________
www.vuiveclub.net
Reply With Quote
  #11  
Old 26 Dec 2007, 13:38
Shaliza Shaliza is offline
 
Join Date: Apr 2006
Nice one. I'm going to try it. Much simpler than the other method that was posted.
Reply With Quote
  #12  
Old 26 Dec 2007, 23:15
Zamurick X Zamurick X is offline
 
Join Date: Dec 2007
Real name: Chase
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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
  #13  
Old 29 Dec 2007, 18:59
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

Last edited by CallieJo; 29 Dec 2007 at 19:06.
Reply With Quote
  #14  
Old 03 Feb 2008, 12:48
CallieJo's Avatar
CallieJo CallieJo is offline
 
Join Date: May 2004
Here is the code I'm currently using (I have other stuff in it but this will pertain to this article):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and change it to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

Last edited by CallieJo; 03 Feb 2008 at 13:00.
Reply With Quote
  #15  
Old 21 Feb 2008, 05:52
cfitzarl cfitzarl is offline
 
Join Date: May 2007
Real name: Chris
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
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 03:45.

Layout Options | Width: Wide Color: