我正在尝试让最后一个重写器在php中获得“lang”。但是,当我打开参数时,它返回“index.php”。以下代码有什么问题?
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*) index.php?lang=$1&url=$2 [NC]
RewriteRule ^([^/]+)/home/([^/]+)/?$ index.php?lang=$1&voorpagina=$2 [NC]
答案 0 :(得分:1)
尝试添加[L]
标志,如下所示:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/home/([^/]+)/?$ index.php?lang=$1&voorpagina=$2 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*) index.php?lang=$1&url=$2 [NC,L]