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

Posts: 1,446
Name: Danalyn
Location: Sherman, TX
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?
__________________
blog explosion | personal | portfolio
techwench is offline
Reply With Quote
View Public Profile Visit techwench's homepage!
 
When You Register, These Ads Go Away!
Old 03-09-2005, 12:59 PM
techwench's Avatar
Code Monkey

Posts: 1,446
Name: Danalyn
Location: Sherman, TX
Fast forward 1 month....

Ta DA! Still no answers.
__________________
blog explosion | personal | portfolio
techwench is offline
Reply With Quote
View Public Profile Visit techwench's homepage!
 
Old 03-09-2005, 01:08 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
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 Visit Anacrusis's homepage!
 
Old 03-09-2005, 01:11 PM
techwench's Avatar
Code Monkey

Posts: 1,446
Name: Danalyn
Location: Sherman, TX
Yeah, you're probably right. Never thought of it that way.
__________________
blog explosion | personal | portfolio
techwench is offline
Reply With Quote
View Public Profile Visit techwench's homepage!
 
Old 03-10-2005, 06:43 PM
Experienced Talker

Posts: 36
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, 07:37 PM
techwench's Avatar
Code Monkey

Posts: 1,446
Name: Danalyn
Location: Sherman, TX
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.
__________________
blog explosion | personal | portfolio
techwench is offline
Reply With Quote
View Public Profile Visit techwench's homepage!
 
Reply     « Reply to mod_rewrite subdomains
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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.14539 seconds with 12 queries