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.
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]
Users browsing this forum: No registered users and 3 guests