标签:nginx 题解 重启 com dmi virtual get target engine
<VirtualHost *:80 *:81>
ServerAdmin deng5765@163.com
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>
但这样写会出现 出现 400 Bad Request 错误
解决方法是将rewrite规则写倒directory中:
<VirtualHost *:80 *:81>
ServerAdmin deng5765@163.com
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>
重启Apache,问题解决
Apache rewrite 出现 400 Bad Request 的解决方法
标签:nginx 题解 重启 com dmi virtual get target engine
原文地址:https://www.cnblogs.com/hnhycnlc888/p/9527667.html