Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.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
Regex 为什么这个mod_重写规则不起作用(通过.htaccess从一个特定url访问另一个特定url)_Regex_.htaccess_Mod Rewrite - Fatal编程技术网

Regex 为什么这个mod_重写规则不起作用(通过.htaccess从一个特定url访问另一个特定url)

Regex 为什么这个mod_重写规则不起作用(通过.htaccess从一个特定url访问另一个特定url),regex,.htaccess,mod-rewrite,Regex,.htaccess,Mod Rewrite,重写规则^/tag/term$/tag/term在此展开[R]如果需要,则需要从模式中删除路径前缀: 在.htaccess文件中使用重写引擎时,每个目录前缀(对于特定目录始终相同)将自动删除以进行模式匹配,并在完成替换后自动添加 对于文档根目录中的.htaccess文件,它是前导的/: 你想要匹配的请求是什么?似乎不起作用。我试图匹配的请求是^tag/term$,并将其重写为此处展开的/tag/term RewriteRule ^tag/term$ /tag/term-expanded-here

重写规则^/tag/term$/tag/term在此展开[R]

如果需要,则需要从模式中删除路径前缀:

在.htaccess文件中使用重写引擎时,每个目录前缀(对于特定目录始终相同)将自动删除以进行模式匹配,并在完成替换后自动添加

对于文档根目录中的.htaccess文件,它是前导的/:


你想要匹配的请求是什么?似乎不起作用。我试图匹配的请求是^tag/term$,并将其重写为此处展开的/tag/term
RewriteRule ^tag/term$ /tag/term-expanded-here [R]