RewriteEngine On RewriteCond %{HTTP_HOST} domain.com RewriteCond %{REQUEST_URI} ^/subdomain/(.*)$ RewriteRule .* http://subdomain.domain.com/%1 [R]