Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
mod_rewrite subdomains
Old 02-09-2005, 08:05 PM mod_rewrite subdomains
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
Okay...does anyone know how the heck to make mod_rewrite work with subdomains?

Here's what I have so far...I have mod_rewrite changing urls from: site.com/profile.php?uid=1234
to: site.com/profile/1234/

Here's the code I'm using now in my .htaccess file:
Code:
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ /$1/ [R,L]
 
RewriteRule ^(.*)/$ /profile.php?uid=$1
Is there anyway to get profile.php?uid=$uid to change to $uid.site.com?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-09-2005, 01:59 PM
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
Fast forward 1 month....

Ta DA! Still no answers.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
Old 03-09-2005, 02:08 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
I could be wrong, but I'm pretty sure it can't be done. Sub domains work off of DNS, so if there is no DNS entry for profile.site.com, the DNS lookup will fail and the browsers request will never make it to the server for the rewrite to happen.
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 03-09-2005, 02:11 PM
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
Yeah, you're probably right. Never thought of it that way.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
Old 03-10-2005, 07:43 PM
Experienced Talker

Posts: 36
Trades: 0
Set up wildcard DNS, then add/change ServerAlias in your <VirtualHost> block to *.yourdomain.com.
tress is offline
Reply With Quote
View Public Profile
 
Old 03-10-2005, 08:37 PM
techwench's Avatar
Code Monkey

Posts: 1,449
Name: Danalyn
Location: Dallas, TX
Trades: 0
Naw. These guys got a cheapie hosting package that's pretty limited. They don't even have SSH access, so I'm just going to have to tell them it can't be done. Thanks.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
techwench is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mod_rewrite subdomains
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.72824 seconds with 12 queries