is the second-level domain name redirected to the directory. Because the second-level domain name is abandoned, it needs to be re-301.
For example, jianfei.xxx.com redirects to www.xxx.com/jianfei
In addition, www needs to be excluded. How to write it?
------------------Change it--------
The questioner said that jianfei is a variable, so the above method will not work.
Consider whether you can create two configuration files
www.xxx.com.conf, no need to rewrite
other.xxx.com.conf, specially used to rewrite to www domain name
The test works
Thank you very much Daniel, this method is better and solved