如果'localhost / a / something'是url,.htaccess会将其重写为'localhost / a / 1.php?food = something'
如果我输入'localhost / a / something something',它会给我404错误 .
我现在的.htaccess:
RewriteEngine on
RewriteBase /a/
RewriteRule ^([A-z]+)$ 1.php?food=$1 [L]
我怎么能'localhost / a / something something'到'localhost / a / 1.php?food = something something'?
2 回答
请看看:
How to redirect %20 or White space automatically to + or - with htaccess?
这似乎做你想做的事......