<virtualhost *:80 *:81>
ServerAdmin [email protected]
Documentroot/active/www/yingchao123/trade
ServerName trade.test.yingchao123.com
Serveralias trade.yingchao123.com
Rewriteengine on
Rewriterule ^ ([\da-z]{1,10}) $./index.php?mod=list&do=unique&alias=$1 [L]
Rewriterule ^ ([\da-z]{1,10}) & (. +) $./index.php?mod=list&do=unique&alias=$1&$2 [L]
</VirtualHost>
But there's a bad Request error when you write this.
The workaround is to write the rewrite rule down in directory:
<virtualhost *:80 *:81>
ServerAdmin[email protected]
Documentroot/active/www/yingchao123/trade
ServerName trade.test.yingchao123.com
Serveralias trade.yingchao123.com
<directory "/active/www/yingchao123/trade" >
Rewriteengine on
Rewriterule ^ ([\da-z]{1,10}) $./index.php?mod=list&do=unique&alias=$1 [L]
Rewriterule ^ ([\da-z]{1,10}) & (. +) $./index.php?mod=list&do=unique&alias=$1&$2 [L]
</Directory>
</VirtualHost>
Restart Apache, problem solving
Description: Apache checks whether the configuration is syntactically incorrect httpd.exe-t or apachectl-t,nginx the corresponding command is NGINX-T
Apache Rewrite solution to the presence of the bad Request