Litblue.net

…游荡在黑夜的灵魂…

blog中图片又回来了

自从将url静态化变成http://litblue.net/p/850这样的形式后
blog中的很多图片就无法显示了
原因是我从pjblog转过来的
附件的引用地址是相对地址如”attachments/jpg.jpg”
原来的http://litblue.net/a.asp?850这样的文章中引用是不会有问题的
但现在多了一层“目录”/p/后相对地址出来的图片url就是http://litblue.net/p/attachments/jpg.jpg
执行如下命令,将数据库中的url全部替换一下,搞定了!

UPDATE wp_posts SET post_content=REPLACE(post_content,'\"attachments','\"/attachments');

posted by blues in 技术相关 and have Comments (2)

2 Responses to “blog中图片又回来了”

  1. blues 说:

    我发现很久了
    不过一直没空理他

  2. harvey 说:

    呵呵,还是我发现的呢。。。。

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment