我写这在我的.htaccess文件:htaccess的代码无法正常运行
RewriteRule ^dashboard/(.*)/([0-9]+)/([0-9]+)/(.*)$ dashboard.php?view=$1&idteam=$2&idplayer=$3&layout=$4 [L]
我希望它应该给我:
[ “视图”] =>串(4 )“team”[“idteam”] => string(1)“5”
[“idplayer”] => string(1)“1”[“layout”] => string(10) “editplayer”
但我得到了这个我nstead:
阵列(3){ [ “视图”] => 串(4) “团队” [ “idteam”] => 串(1) “5” [ “布局” ] => 串(13) “1/editplayer” }
这是URL:
仪表板/团队/ 5/1/editplayer
这是我整个的htaccess:
ErrorDocument 404 /index.php
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^wmisports.com
RewriteRule (.*) http://www.wmisports.com/$1 [R=301,L]
#AddType application/x-httpd-php .html .htm
RewriteRule ^dashboard$ dashboard.php [L]
RewriteRule ^dashboard/view/newteam/(.*)$ dashboard.php?view=newteam&idcaptain=$1 [L]
RewriteRule ^dashboard/view/team/(.*)$ dashboard.php?view=team&idteam=$1 [L]
RewriteRule ^dashboard/team/([0-9]+)/(.*)$ dashboard.php?view=team&idteam=$1&layout=$2 [L]
#RewriteRule ^dashboard/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ dashboard.php?view=$1&idteam=$2&idplayer=$3&layout=$4 [L]
RewriteRule ^dashboard/([^/]+)/([^/]+)/([^/]+)/([^/]*)/?$ dashboard.php?view=$1&idteam=$2&idplayer=$3&layout=$4 [L]
可以请sombody帮助理解什么是错我的代码。由于
尝试没有贪婪:'^仪表板/(。 (^ ^)/([0-9] +)/([0-9] +)/(。+?)$' –
或者更好的是通过'[^ /] +'在测试丹尼斯之一时出现内部错误 –
或甚至'^ dashboard /([^ /] +)/([^ /] +)/([^ /] +)/([^ /] +)$' – claustrofob