|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
9 posts
Gave thanks: 0
Thanked 0 times
|
htaccess redirect
I'm not very good with rewrites or regex's. Can anyone please tell me how to setup a rewrite so that when someone on my site goes to
mysite.com/users/USERNAME they are redirected to something like mysite.com/users/setUser.php?user=USERNAME thanks |
|
|
|
|
|
#2 (permalink) | |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
Quote:
Try something like that. It should also make it redirect to user/username/ if they only put in user/username. |
|
|
|
|
|
|
#3 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} ^users/(.*) RewriteRule (.*) /users/setUser.php?user=%1
__________________
Nobody doing nothing |
|
|
|
|
|
#4 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
oh.. d already posted... shucks, this is what i get for idling away from the computer before replying
__________________
Nobody doing nothing |
|
|
|
|
|
#7 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
9 posts
Gave thanks: 0
Thanked 0 times
|
Ok, so I have one more for you. I'm trying to set so that when someone goes to *virtualhost*.mysite.com, it redirects them to mysite.com/browse/*virtualhost*
this is what I've got so far, but it's not working: RewriteCond %{HTTP_HOST} (.*).mysite.com [nc] RewriteRule ^/(.*) http://mysite.com/browse/$1 Thanks again for helping me with the last one, it worked great. |
|
|
|
|
|
#8 (permalink) |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
your use of * is confusing me as to what you're actually trying to do
This may help: http://www.yourhtmlsource.com/sitema...rewriting.html |
|
|
|
|
|
#9 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
9 posts
Gave thanks: 0
Thanked 0 times
|
Thanks David. I checked that site out but it's still really confusing to me. I would like to make it so that when somebody goes to virtualhost.mysite.com they are redirected to mysite.com/browse?dir=virtualhost.
I hope that's a little clearer, it's 3:13 a.m. where I'm at and my brain is a little bit fried right now trying to work on this thing. Thanks again for all your help |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|