Wordpress:将图片、post等的URL转换为相对路径

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

例如上传一张图片,其地址是可能 http://127.0.0.1/wp-content/uploads/2015/12/1_.png, 问题是如果我们通过其他的电脑通过wordpress主机的公网IP访问这张图片时会提示找不到。

最好的处理方法是不带URL中不带IP或者域名,例如/wp-content/uploads/2015/12/1_.png.

wordpress有一些插件可以实现这个功能:

Relative Image URLs: https://wordpress.org/plugins/relative-image-urls/

Root Relative URLs: https://wordpress.org/plugins/root-relative-urls/

一些讨论

http://stackoverflow.com/questions/17187437/relative-urls-in-wordpress

https://wordpress.org/support/topic/using-relative-instead-of-absolute-links-for-images

修改wordpress图片地址为相对路径: http://www.3code.cn/wordpress-path/

转载于:https://my.oschina.net/letiantian/blog/598292

你可能感兴趣的:(Wordpress:将图片、post等的URL转换为相对路径)