Garayed.com  

Go Back   Garayed.com > Apache Configurations
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-29-2008, 03:57 PM
Danny
 
Posts: n/a
Default Using mod_rewrite to rewrite http://<user ID>.<domain name>/ to

Here is what I tried in a .htaccess file in my virtual host's document
root:

RewriteCond {SCRIPT_FILENAME} !^membersignin$ [NC]
RewriteCond {HTTP_HOST} ^([^\.]+)\.mydomainname\.com [NC]
RewriteRule ^(.*)$ http://mydomainname.com/membersignin/?userid=%1
[R=301,QSA,NC,L]

This works great for:

http://www.mydomainname.com/

which is rewritten to:

http://mydomainname.com/membersignin/?userid=www

But;

http://dhhoyle.mydomainname.com/

gets a Page Load Error, looking for dhhoyle.mydomainname.com.

That is, no rewrite took place!

This is my first attempt at using mod_rewrite. Any help would be
appreciated.

Thanks,

Danny
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-30-2008, 09:07 AM
phantom
 
Posts: n/a
Default Re: Using mod_rewrite to rewrite http://<user ID>.<domain name>/ to http://<domain name>/?userid=<user ID>

"Danny" <dhhoyle@gmail.com> wrote in message
news:eae46939-4bb4-448f-aeef-3499b5cae920@59g2000hsb.googlegroups.com...
> Here is what I tried in a .htaccess file in my virtual host's document
> root:
>
> RewriteCond {SCRIPT_FILENAME} !^membersignin$ [NC]
> RewriteCond {HTTP_HOST} ^([^\.]+)\.mydomainname\.com [NC]
> RewriteRule ^(.*)$ http://mydomainname.com/membersignin/?userid=%1
> [R=301,QSA,NC,L]
>
> This works great for:
>
> http://www.mydomainname.com/
>
> which is rewritten to:
>
> http://mydomainname.com/membersignin/?userid=www
>
> But;
>
> http://dhhoyle.mydomainname.com/
>
> gets a Page Load Error, looking for dhhoyle.mydomainname.com.
>


That would suggest that either:
you don't have DNS for *.mydomainname.com
or your virtual host entry doesn't contain
ServerAlias *.mydomainname.com


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:52 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.