admin管理员组文章数量:1317904
To increase site loading time and decrease the pressure on my website I have decided to host files(js,css,images) in other hosting, like google storage or amazon aws, problem is that I already published a lot of posts that includes images other files in the html, like:
<img src="site.example/wp-content/uploads/images/image.png">
i can't go all over the posts to change the src attribute, so I want to change my route code so every time a wp-content or wp-includes files is requested, it will redirect it to the host where my media files are, something like:
if(str_contains($path, 'wp-content') || str_contains($path, 'wp-includes')){
redirect("host.example".$path);
}
本文标签: uploadsHow to change Route respond To A specific Path
版权声明:本文标题:uploads - How to change Route respond To A specific Path? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742032210a2416658.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论