Wordpress 3 多站点配置子站点无法显示图片问题 , 附Nginx伪静态配置
来源:互联网 发布:电脑解压软件推荐 编辑:程序博客网 时间:2024/04/29 22:00
nginx+php+wordpress 3.1的环境下,
所有图片下载完成后,Firefox显示"图像 “XXXX” 因其本身有错无法显示。" , FireBug显示”Image corrupt or truncated“
把图片下载下来,用16进制编辑器打开,发现比通常的文件头多了”EF BB BF“,这显然是UTF8的DOM签名。
估计是伪静态转接时,没有清理干净。
打开wp-includes/ms-files.php
在最后
// If we made it this far, just serve the file
readfile( $file );
改为
// If we made it this far, just serve the file
// fix utf-8 dom
ob_clean();
flush();
readfile( $file );
flush();
即可。
另附ngnix伪静态配置
SubDomain 子域名模式:
#on server block
##necessary if using a multi-site plugin
server_name_in_redirect off;
##necessary if running Nginx behind a reverse-proxy
port_in_redirect off;
rewrite ^/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^ /index.php last;
}
SubFolder 子目录模式:
#on server block
##necessary if using a multi-site plugin
server_name_in_redirect off;
##necessary if running Nginx behind a reverse-proxy
port_in_redirect off;
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*/.php)$ $1 last;
rewrite ^ /index.php last;
}
升级为多站点后,原主站可能发生文章链接404的情况,进后台重新选个”固定链接“的格式,修改下即可。
- Wordpress 3 多站点配置子站点无法显示图片问题 , 附Nginx伪静态配置
- nginx 静态站点配置
- nginx多站点配置问题
- nginx多站点配置
- Nginx 多站点配置
- nginx多站点配置
- nginx 多站点配置
- Nginx多站点配置
- nginx配置多站点
- Nginx多站点配置
- nginx配置多站点
- nginx 配置多站点
- nginx下wordpress路径、伪静态配置
- 配置静态站点,修改Nginx默认根目录
- Nginx 的多站点配置
- Nginx 的多站点配置
- Nginx 的多站点配置
- Nginx 的多站点配置
- 关于编程,鲜为人知的真相
- 关于android 打包问题
- 每个程序员都该阅读的书
- PHP 上传图片操作流程
- 回调函数
- Wordpress 3 多站点配置子站点无法显示图片问题 , 附Nginx伪静态配置
- this关键字,super关键字,就这么几种用法,记住就是了!
- oracle 服务
- 计数排序
- 用ADS调试硬件过程
- zoj 1974 || poj 1940 Polygon Programming with Ease
- ld: /ubuntu/omnibook/sections.lds: No such file: No such file or directory解决
- 网络编程杂项 (持续更新)
- 自写atoi实现函数