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)

Shaliza 12-26-2007 11:38 AM

Nice one. I'm going to try it. Much simpler than the other method that was posted.

Zamurick X 12-26-2007 09:15 PM

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. :)

CallieJo 12-29-2007 04:59 PM

Quote:

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

CallieJo 02-03-2008 10:48 AM

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.

cfitzarl 02-21-2008 03:52 AM

I would suggest using:

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

When you have (.*), that can stand for any letter, number, or symbol.

CallieJo 03-03-2008 03:57 PM

Quote:

Originally Posted by cfitzarl (Post 1447862)
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.

cheat-master30 03-08-2008 04:15 PM

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?

NeverBored 05-24-2008 05:44 AM

Quote:

Originally Posted by cheat-master30 (Post 1460123)
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?

cheat-master30 05-31-2008 07:57 PM

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.

NeverBored 05-31-2008 09:00 PM

Quote:

Originally Posted by cheat-master30 (Post 1537280)
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.


All times are GMT. The time now is 01:21 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.01187 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
  • (5)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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