Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/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 重定向规则使用双斜杠创建链接_Regex_Apache_.htaccess_Redirect - Fatal编程技术网

Regex 重定向规则使用双斜杠创建链接

Regex 重定向规则使用双斜杠创建链接,regex,apache,.htaccess,redirect,Regex,Apache,.htaccess,Redirect,我想重定向一个类似这样的链接:www.mysite.com/article905.html/到www.mysite.com/article title/,但我不知道怎么做 我已尝试向.htaccess添加重定向规则,如下所示: Redirect permanent /article905.html/ http://www.mysite.com/article-title/ 但一旦应用,系统实际上会将我重定向到http://www.mysite.com/article-title// 如何避免双

我想重定向一个类似这样的链接:
www.mysite.com/article905.html/
www.mysite.com/article title/
,但我不知道怎么做

我已尝试向.htaccess添加重定向规则,如下所示:

Redirect permanent /article905.html/ http://www.mysite.com/article-title/
但一旦应用,系统实际上会将我重定向到
http://www.mysite.com/article-title//


如何避免双斜杠?

使用
RedirectMatch
进行正则表达式匹配:

RedirectMatch 301 ^/article905\.html/?$ http://www.mysite.com/article-title/

再次感谢阿努巴瓦。