所以想要完成(使用.htaccess)我可以重写这个url:
?的index.php控制器= ControllerName&安培;方法=&方法名放大器;图= VIEWNAME&安培;键=值&安培;键2 =值
对此:
/ ControllerName /方法名/ VIEWNAME /键=值&安培;键2 =值
这是我现在的代码:
RewriteEngine On
RewriteRule ^(.*)/(.*)/(.*)/(.*) index.php?controller=$1&method=$2&view=$3&$4=$5 [L]
RewriteRule ^(.*)/(.*)/(.*)/ index.php?controller=$1&method=$2&view=$3 [L]
答案 0 :(得分:1)
尝试此规则,
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?controller=$1&method=$2&view=$3 [QSA,L]