Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 02-11-2008, 09:00 PM
kau kau is offline
 
Join Date: Jul 2002
Posts: 253
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Rewrite Help

I need some help with mod_rewrite.

I have setup a subdomain that uses member.php

subdomain.domain.com/member.php

I want to set it up so

subdomain.domain.com/Username/

Will go to;

subdomain.domain.com/member.php?username=Username

However they will never know the member.php path. It just stays at subdomain.domain.com/Username/

I can do this using;

RewriteCond %{REQUEST_URI} ^(.*)/
RewriteRule ^([^/]*)/$ member.php?username=$1

However this presents some issues. If you hit
subdomain.domain.com/Username it errors out.

I've tried some code to add the trailing slash but it gets confused when a user name has a . in it.

Any help would be appreciated.
Reply With Quote
  #2  
Old 02-11-2008, 09:06 PM
MiahBeSmokin420 MiahBeSmokin420 is offline
 
Join Date: May 2007
Location: Ohio
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dude omg

if you can make it so lets say:

MyExampleForum.com/member.php?username=Username

if you can make it so i can get there by going to lets say:

MyOtherDomain.com/username

if you can make it so i can do that i would be willing to pay for that
Reply With Quote
  #3  
Old 02-12-2008, 02:49 AM
Eikinskjaldi's Avatar
Eikinskjaldi Eikinskjaldi is offline
 
Join Date: Feb 2006
Location: Hell, never looked better
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Note: none of this is tested

Try this. Don't bother with a rewrite condition.
RewriteRule ^/([^/]+)/$ member.php?username=$1

This following example may not work because I don't know if mod_rewrite supports look ahead assertions, but it is a bit more robust (it doesnt try to convert php urls)

RewriteCond %{REQUEST_URI} ^/([^./]+)/$|^/([^/]+\.(?!php($|\?))(.*))/$ [NC]
RewriteRule ^/([^/]+)/$ member.php?username=$1

Quote:
MyExampleForum.com/member.php?username=Username
if you can make it so i can get there by going to lets say:
MyOtherDomain.com/username
RewriteCond %{HTTP_HOST} MyOtherDomain\.com [NC]
RewriteRule ^/(.*) http://MyExampleForum.com/member.php?username=$1 [L,R]
Reply With Quote
  #4  
Old 02-12-2008, 06:17 AM
MiahBeSmokin420 MiahBeSmokin420 is offline
 
Join Date: May 2007
Location: Ohio
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ya none of them worked but i did find a way to do it

but thanks anyways
Reply With Quote
  #5  
Old 02-12-2008, 08:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where are you putting the rules?
Reply With Quote
  #6  
Old 02-12-2008, 09:01 AM
MiahBeSmokin420 MiahBeSmokin420 is offline
 
Join Date: May 2007
Location: Ohio
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if your talking to me then

here this will help you out i posted how to do it since it was not posted anywhere else here on the site and ya

here is the link

https://vborg.vbsupport.ru/showthrea...31#post1441331
Reply With Quote
  #7  
Old 02-12-2008, 09:04 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought you said it DIDN'T work. I thought you weren't putting them in htaccess and in somewhere else (eg. in a plugin).
Reply With Quote
  #8  
Old 02-12-2008, 09:13 AM
MiahBeSmokin420 MiahBeSmokin420 is offline
 
Join Date: May 2007
Location: Ohio
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no the ones he posted didnt work i did a lil research and got one to work

the one that i got to work for IE and FF i posted the tutorial and all that
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:33 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.04092 seconds
  • Memory Usage 2,218KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete