.htaccess 301重定向无法与url中的%20一起使用

.htaccess 301重定向无法与url中的%20一起使用,.htaccess,http-status-code-301,.htaccess,Http Status Code 301,我正在尝试创建此重定向: Redirect /commercial%20work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html 问题是,当我第一次创建这个页面时,我在文件名中留下了一个空格。换句话说,它是“/commercial work.html”。在chrome和safari中,url的内容如上所述,并用%20代替空格,但当我创建此重定向时,它不起作用。我还尝试了以下方法: Redire

我正在尝试创建此重定向:

Redirect /commercial%20work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html
问题是,当我第一次创建这个页面时,我在文件名中留下了一个空格。换句话说,它是“
/commercial work.html
”。在chrome和safari中,url的内容如上所述,并用
%20
代替空格,但当我创建此重定向时,它不起作用。我还尝试了以下方法:

Redirect /commercial work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html
这也行不通。它会导致出现服务器错误页面。有人有什么建议吗?谢谢

尝试添加引号。所以

Redirect "/commercial work.html" http://nataliearriolaphotography.com/fine-art-photography-prints.html

将页面名称放在引号中应该这样做,例如:

Redirect 301 "/commercial work.html" http://nataliearriolaphotography.com/fine-art-photography-prints.html

格本,谢谢你的回答,但那也不行。它会导致出现服务器错误页面。也许跟肥牛有关?事实上,我错过了引文。让我再试一次!对不起@福音3258你说的肥牛是什么意思?不客气。作为回报,请将其标记为已回答。谢谢。您好,我正在尝试让它工作,但此案例不使用引号,出现500个错误(尝试了多种变体)
RedirectMatch 301^/2012文件/(.*)$/archives/old-website/2012文件/$1
@Yatko是否加载了
mod_-alias
模块?另外,请尝试重定向匹配301^/2012\files/(.*)$/archives/old-website/2012\files/$1