Need help

Using a single web hosting account to host multiple sites

Need help

Postby schmidtjason1 » Fri Oct 16, 2009 7:30 pm

I'm newbie to mod_rewrite and need help with the following:

1. Transfer http://domianuser.domain.com to http://www.domain.com/index.php?user=domainuser
2. Append the following query string to each link: user=domainuser

Please help.
schmidtjason1
 
Posts: 1
Joined: Fri Oct 16, 2009 7:23 pm

Postby richardk » Sat Oct 17, 2009 6:24 am

FAQ: Virtual sub domains.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

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


Return to Domain Handling

Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests

cron