RewriteEngine on RewriteCond %{REQUEST_URI} ^/$ RewriteRule ^(.*) /en/ [L,NC,R,QSA] RewriteRule ^(en|he)/(.*)/$ /index.php?pagid=$2&langimg=$1 [L,NC,QSA] RewriteRule ^(en|he)/$ /index.php?pagid=Index&langimg=$1 [L,NC,QSA] // i got this rule, but instad of it i want to convert the rule to subdomain. so if user goes to en.mysite.com/ it will set a parameter of langimg=en ... is that possible?