rewrite variables to subdomain

Using a single web hosting account to host multiple sites

rewrite variables to subdomain

Postby aoplus » Fri Aug 31, 2007 5:17 am

real url = http://domain.com/u=username

i need change to .. http://username.domain.com/


- can i do ?
- config bind ? or Not eg. *.domain.com


Thank for sugguest ..


have a lucky
aoplus
 
Posts: 2
Joined: Fri Aug 31, 2007 5:09 am

Postby richardk » Fri Aug 31, 2007 4:02 pm

You must create DNS records for the sub domains (or Wildcard DNS for all sub domains). The sub domains must go to your document root on your server. Then you can use the following in a .htaccess file in your document root
Code: Select all
options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
RewriteRule ^$ /?u=%1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby aoplus » Sat Sep 01, 2007 9:55 am

Thank ... you very much ...
aoplus
 
Posts: 2
Joined: Fri Aug 31, 2007 5:09 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 46 guests

cron