0

这是我当前的 htaccess 文件

DirectoryIndex index.php

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^register/ index.php?view=register [L]

RewriteRule ^news/([0-9]+)/[0-9a-z\-]*/$ index.php?view=news&id=$1&page=$2 [L]
RewriteRule ^movie/([0-9]+)/[0-9a-z\-]*/$ index.php?view=movies&id=$1&title=$2 [L]
RewriteRule ^actor/([0-9]+)/[0-9a-z\-]*/$ index.php?view=actor&id=$1&name=$2 [L]

RewriteRule ^country/([0-9]+)/[0-9a-z\-]*/$ index.php?view=country&id=$1&name=$2 [L]
RewriteRule ^country/([0-9]+)/[0-9a-z\-]/[0-9]*/$ index.php view=country&id=$1&name=$2$country=$3 [L]

问题是如果我访问 domain.com/country/3/usa/1/ 它找不到 attr "country"

我试过做

回声 $_GET['country'];

但它只返回一个未识别的变量。

提前致谢

4

1 回答 1

2

您的最后一个条目缺少问号:

RewriteRule ^country/([0-9]+)/[0-9a-z\-]/[0-9]*/$ index.php?view=country&id=$1&name=$2&country=$3 [L]
于 2013-10-24T20:06:02.343 回答