vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Rewrite Help (https://vborg.vbsupport.ru/showthread.php?t=170255)

kau 02-11-2008 09:00 PM

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.

MiahBeSmokin420 02-11-2008 09:06 PM

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

Eikinskjaldi 02-12-2008 02:49 AM

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]

MiahBeSmokin420 02-12-2008 06:17 AM

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

but thanks anyways

Dismounted 02-12-2008 08:00 AM

Where are you putting the rules?

MiahBeSmokin420 02-12-2008 09:01 AM

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

Dismounted 02-12-2008 09:04 AM

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

MiahBeSmokin420 02-12-2008 09:13 AM

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


All times are GMT. The time now is 04:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01050 seconds
  • Memory Usage 1,724KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete