I want to write a rewrite scheme such that:
user1.example.net
will redirect toexample.net/user/user1
user2.example.net
will redirect toexample.net/user/user2
This is what I have in my .htaccess
code. But it always redirects to example.net
.
RewriteCond %{http_host} ^[^.]+\.example\.net [NC]
RewriteRule ^([^.]+)\.example\.net(.*) http://example.net/user/$1 [R=301,L]
Can someone please tell me what I did wrong?