之前,我一直在使用域切分来提供来自无CookieList域的图像。我已更改域中的所有路径。com/wp内容/上传/*到/媒体/使用以下htaccess规则:
RedirectMatch 301 ^/wp-content/uploads/(.*)$ https://media.domain.com/$1
这导致以下链接:
https://www.domain.com/wp-content/uploads/2017/08/image.jpeg
要重定向到:
https://media.domain.com/2017/08/image.jpeg
昨天我切换到HTTP/2,这使得“域切分”不再必要。所以这一次,我想做oposite切换,从媒体切换。领域com到域。com/wp内容/上传。我在htaccess文件中放置了以下内容:
RedirectMatch 301 ^(.*)$ https://www.domain.com/wp-content/uploads$1
但是,这会导致无限循环:
https://www.domain.com/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/wp-content/uploads/2017/08/image.jpeg
我做错了什么?
编辑:很高兴知道“媒体”是一个子域,位于主网站的“public\\u html”目录中。因此,public\\u html是主网站,public\\u html/media是媒体文件夹。htaccess位于public\\u html中