解决SAE WordPress Storage图片无法访问问题

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);
function callback($buffer)
{
   
  return (str_replace("sinaapp.com", "vipsinaapp.com", $buffer));
}

ob_start("callback");


/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
ob_end_flush();

在Wordpress的index.php文件添加上面的代码即可。
或者直接替换成上面的代码。

原理很简单:打开输出缓存,将所有的sinaapp.com更换为vipsinaapp.com即可。