现在我在 .htaccess 文件中使用这些
RewriteRule (.*)/(.*)/(.*)/(.*)\.html$ index.php?lng=$1&page=$2&subpage=$3&subpage1=$4 [L]
RewriteRule (.*)/(.*)/(.*)\.html$ index.php?lng=$1&page=$2&subpage=$3 [L]
RewriteRule (.*)/(.*)\.html$ index.php?lng=$1&page=$2 [L]
RewriteRule (.*)\.html$ index.php?page=$1 [L]
RewriteRule index\.html$ index.php [L]
并且工作正常。
如果我想添加另一个子页面,那么我必须输入一个包含所有获取的新 RewriteRule。例如,如果我想在前面的代码中添加另一个子页面,我应该输入:
RewriteRule (.*)/(.*)/(.*)/(.*)/(.*)\.html$ index.php?lng=$1&page=$2&subpage=$3&subpage1=$4&subpage1=$5 [L]
但是我怎样才能使它更简单和通用来处理所有获取?
注意:我不关心 GET 名称(页面、子页面 1 ....)
编辑:我希望能够获取查询字符串,但我不关心名称(键):page、subpage、subpage1 等