我需要将所有文件从一台服务器重定向到另一台服务器
例如
www.example.com/file.php 至 www.example2.com/files/file.php
RedirectPermanent /file.php http://example2.com/files/file.php
效果很好。如何用它重定向多个文件?
感谢您的帮助!
答案 0 :(得分:1)
要将多个文件从一个服务器重定向到另一个服务器,您需要使用带有正则表达式模式的RedirectMatch指令。
在example1.com/.htaccess中试试这个:
RedirectMatch 301 ^/(.*)$ http://example2.com/files/$1