views:

64

answers:

1

username.domain.com/file rewrite to

domain.com/q.php?user=username&url=file

how do that?

Thanks. Sorry for my English.

A: 

Try this rule:

RewriteCond %{HTTP_HOST} ^([^./]+)\.example\.com$
RewriteCond %1 !=www
RewriteRule .+ http://example.com/q.php?username=%1&file=$0 [L,QSA]
Gumbo