redirect username to subdomain
i need to a script that it can do it
blogname.d开发者_如何学编程omain.com = > http://www.domain.com/blogname/
i think it possible with .htaccess file but i dont know it, so help me
thanks alot
In .htaccess you can do the following
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) http://www.domain.com/$1$2
This rewrites http://username.domain.com/anypath
internally to http://www.domain.com/username/anypath
精彩评论