简体   繁体   English

Wordpress:如何更改所有现有的媒体路径?

[英]Wordpress: How to change all existing media paths?

so recently i discovered amazon web services and decided that this is my future. 所以最近我发现了亚马逊网络服务,并决定这是我的未来。 What i have done i exported all media to my pc and uploaded to amazon s3 storage made bucket public and now i need to change all urls on my wordpress that it would read from amazon. 我所做的一切将所有媒体导出到我的PC并上传到Amazon s3存储,从而使存储桶公开了,现在我需要更改wordpress上从Amazon读取的所有URL。

So what i need to know how is that possible, i know that via sql update is one way to go also you can write small php code to do it and there is also couple of plugins that actually transfers your media to amazon s3 but those ones was outdated. 所以我需要知道这是怎么可能的,我知道通过sql update是一种方法,您也可以编写小的php代码来完成此操作,并且还有一些插件可以将您的媒体实际转移到Amazon s3,但那些插件已经过时了。

So i have now media like this: mydomain.com/wp-content/uploads/2015/03/myphoto.jpg Wat i need is change path to: amazondomainandbucket.com/wp-content/uploads/2015/03/myphoto.jpg 所以我现在有这样的媒体:mydomain.com/wp-content/uploads/2015/03/myphoto.jpg我需要将路径更改为:amazondomainandbucket.com/wp-content/uploads/2015/03/myphoto.jpg

I have amazon subdomian, i alrerady uploaded all my uplodas folder in it i have couple ways to go which i wrote above but just looking for good advice maybe there existing some plugin which is able to do that? 我有亚马逊subdomian,我已将所有uplodas文件夹上传到其中,我有几种写在上面的方法,但是只是寻找好的建议,也许已有一些插件可以做到这一点? Im using newest wordpress version 4.1.1 (i believe its this) 我正在使用最新的WordPress版本4.1.1(我相信它是这个)

Thank you. 谢谢。

You should run string replace befor uploading the database. 您应该在上载数据库之前运行字符串替换。

  1. dump the database 转储数据库
  2. open the file in notepadd++ (or similar) 在notepadd ++(或类似文件)中打开文件
  3. replace all urls and save 替换所有网址并保存
  4. import the database 导入数据库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM