RewriteRule以提取可选的时间参数


RewriteRule to extract an optional time parameter

有人能帮助我使以下URL正常工作吗:

localhost/v/KmV9ffyC2kA
localhost/v/KmV9ffyC2kA?t=3m2s

我真的不知道为什么这个重写规则不起作用:

RewriteRule ^v/(.*)'??t=(.*)$    index.php?v=$1&t=$2 [R]

非常感谢!

QUERY_STRINGRewriteRule中不匹配。在DOCUMENT_ROOT/.htaccess文件中尝试此规则:

RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)t=([^&]*)(&|$) [NC]
RewriteRule ^v/([^/]*)/?$ index.php?v=$1&t=%1 [L,QSA,NC]