Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .HTACCESS Mod Rewrite是否不带后缀?_Apache_.htaccess_Mod Rewrite_Url Rewriting - Fatal编程技术网

Apache .HTACCESS 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 改写为

我正试图让下面的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

改写为

www.example.co.uk/test/brand/video/

但我不能让它为你工作

www.example.co.uk/test/brand/video


尝试将正则表达式从
^test/([^/]*)/([^/]*)/$
更改为
^test/([^/]*)/([^/]*)/?$