尽管尚不完全清楚您的问题是什么,但您应该意识到您的重写条件仅适用于它之后的重写规则,因此您的文件读取为:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^vip/$ vip/index.php [QSA]
RewriteRule ^admin/$ admin/index.php [QSA]
RewriteRule ^([^-]+)/$ /initial/function.php?stat=$1&%{QUERY_STRING} [QSA]
您可能希望将条件放在每个重写规则之前:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^vip/$ vip/index.php [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/$ admin/index.php [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^-]+)/$ /initial/function.php?stat=$1 [QSA]
编辑:根据您的评论,您似乎只需要:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^\w+$ /function.php?user_name=$1 [QSA] // if a username can only contain a-z, 0-9 and _