我正在用我尝试实施几天的重写规则来拉扯头发,因为我已经完全重新完成了一个网站,现在必须将旧 URL 重定向到新 URL
(备注:在 Windows 2008R2 上运行 Apache)
旧链接始终是:
www.domain.com/files/
新链接是:domain.com/_fileuploads/
示例(旧)URL 将是 www.domain.com/files/Media/Statistics/Germany/services%202003-2012.pdf
我几乎尝试了一切:
Redirect 301 /files/Media/Statistics/Germany/services%202003-2012.pdf$ http://domain.com/_fileuploads/entries/Statistics/services%202003-2012.pdf
RewriteRule ^/files/Media/Statistics/Germany/services%202003-2012\.pdf$ http://domain.com/_fileuploads/entries/Statistics/services%202003-2012.pdf [NC,R=301,L]
RedirectMatch 301 /files/Media/Statistics/Germany/services%202003-2012.pdf$ http://domain.com/_fileuploads/entries/Statistics/services%202003-2012.pdf
上述解决方案都不适合我,我总是得到 404 not found 非常感谢您的明智输入。