Apache .HTACCESS Mod Rewrite是否不带后缀?
我正试图让下面的Mod Rewrite在后缀或文件名中没有尾随斜杠Apache .HTACCESS Mod Rewrite是否不带后缀?,apache,.htaccess,mod-rewrite,url-rewriting,Apache,.htaccess,Mod Rewrite,Url Rewriting,我正试图让下面的Mod Rewrite在后缀或文件名中没有尾随斜杠 RewriteEngine On RewriteRule ^test/([^/]*)/([^/]*)/$ /example1/example2/index.php?brand= $1&video=$2 [L] 但是,如果我从/$中删除尾随斜杠,上面的方法就不起作用了 因此,简单回顾一下: www.example.co.uk/example/example2/index.php?brand=x&video=y 改写为
RewriteEngine On
RewriteRule ^test/([^/]*)/([^/]*)/$ /example1/example2/index.php?brand=
$1&video=$2 [L]
但是,如果我从/$中删除尾随斜杠,上面的方法就不起作用了
因此,简单回顾一下:
www.example.co.uk/example/example2/index.php?brand=x&video=y
改写为
www.example.co.uk/test/brand/video/
但我不能让它为你工作
www.example.co.uk/test/brand/video
尝试将正则表达式从
^test/([^/]*)/([^/]*)/$
更改为^test/([^/]*)/([^/]*)/?$