我试图从一个死链接重定向到一个新链接。
来源https://www.gillespaulesnault.com/esnault%20painting/html/bluenote.htm
目标https://www.gillespaulesnault.com/project/blue-note-a-la-huchette/
第一个解决方案
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^esnault%20painting/html/bluenote.htm
https://www.gillespaulesnault.com/project/blue-note-a-la-huchette/ [R=301,L,NC]
</IfModule>
第二种解决方案
Redirect 301 ^esnault%20painting/html/bluenote.htm https://www.gillespaulesnault.com/project/blue-note-a-la-huchette/
无法使其工作。谢谢
您也可以使用RedirectMatch
:
RedirectMatch 301 ^esnault%20painting/html/bluenote.htm$ https://www.gillespaulesnault.com/project/blue-note-a-la-huchette/
阅读更多信息:https://httpd.apache.org/docs/current/mod/mod_alias.html#redirectmatch