我已经把我所有的资产切换到新的服务器;但是,当有人打开旧的电子邮件时,以前的图像路径链接被破坏了。
我正在尝试使用htaccess将请求重定向到旧服务器到新服务器,但我无法这样做。
我在旧服务器上使用htaccess的尝试
RewriteRule ^/email/images/(.*)$ http://pathtonewserver/images/$1 [L,R=301]
RewriteRule ^.*email/images/(.*)$ http://pathtonewserver/images/$1 [L,R=301]
在尝试使用重写引擎之前打开它总是好的做法。检查模块是否安装在服务器上可能也是谨慎的做法:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/email/images/(.*)$ http://pathtonewserver/images/$1 [L,R=301]
</IfModule>
在旧服务器中,添加以下重定向:
RedirectMatch 301 ^/email/images/(.*)/?$ http://newserver/images/$1