例如上傳一張圖片,其地址是可能 http://127.0.0.1/wp-content/uploads/2015/12/1_.png
, 問題是若是咱們經過其餘的電腦經過wordpress主機的公網IP訪問這張圖片時會提示找不到。wordpress
最好的處理方法是不帶URL中不帶IP或者域名,例如/wp-content/uploads/2015/12/1_.png
.url
wordpress有一些插件能夠實現這個功能:插件
Relative Image URLs: https://wordpress.org/plugins/relative-image-urls/code
Root Relative URLs: https://wordpress.org/plugins/root-relative-urls/圖片
一些討論get
http://stackoverflow.com/questions/17187437/relative-urls-in-wordpress域名
https://wordpress.org/support/topic/using-relative-instead-of-absolute-links-for-imagesio
修改wordpress圖片地址爲相對路徑: http://www.3code.cn/wordpress-path/plugin