vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Shorter Profile Url (https://vborg.vbsupport.ru/showthread.php?t=165986)

CallieJo 12-22-2007 10:00 PM

Shorter Profile Url
 
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

Zamurick X 12-23-2007 08:56 PM

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.

CallieJo 12-23-2007 09:51 PM

Quote:

Originally Posted by Zamurick X (Post 1407831)
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.

hocphp 12-23-2007 10:53 PM

i' ll downloading this mod for research and use

CallieJo 12-23-2007 11:55 PM

Your welcome;)

aycan555 12-24-2007 12:40 AM

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

JawadIT 12-24-2007 03:45 AM

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

Marco van Herwaarden 12-24-2007 09:33 AM

Not a modification, moved to articles section.

CallieJo 12-24-2007 05:41 PM

Quote:

Originally Posted by JawadIT (Post 1408092)
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:

Quote:

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 [DATE]1198525319[/DATE] at [TIME]1198525319[/TIME] ---------------

Quote:

Originally Posted by Marco van Herwaarden (Post 1408238)
Not a modification, moved to articles section.

Thank you. I wasn't sure where to place this.

vuiveclub 12-25-2007 02:13 PM

How can I rewrite some unicode characters as "â ă â ã ạ ả á à ắ ầ " etc to "English character if I use this Rewrite?


All times are GMT. The time now is 06:38 PM.

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.01087 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete