fbzl
V2EX  ›  问与答

Wordpress 前后台分离问题

  •  
  •   fbzl · Aug 14, 2014 · 4494 views
    This topic created in 4381 days ago, the information mentioned may be changed or developed.
    由于一些原因,想将Wordpress建的网站前后台分离,前台放在国外服务器上,后台在国内服务器上使用已备案的二级域名。

    国外服务器只保留用于显示的PHP和主题文件。
    国内服务器后台图片以及其他资源。

    具体实施上两套程序都连接一个数据库,图片等连接使用国内二级域名连接,然后删掉不必要的文件,有什么需要注意的地方吗?

    有什么好的静态化插件吗?用过cos-html-cache,但是貌似不支持前后台分离控制。

    想过反向代理,但是感觉不完美。
    3 replies    2014-08-14 19:07:56 +08:00
    weiceng
        1
    weiceng  
       Aug 14, 2014
    为了保证速度和方便切换服务器,我自己网站用的这种方案,说说自己用的方法吧:
    ---
    所有网站静态资源都托管在upyun。
    A)过滤掉 将主题文件夹PHP全部删除,以相同文件夹及路径存储静态资源到upyun,替换主题相关的链接为(例如:get_template_directory_uri()等路径为静态服务器的路径)
    B) 文章内图片资源等,使用插件,http://github.ihacklog.com/hacklog-remote-attachment-upyun/;如果你使用自己的FTP服务器可以用(Hacklog Remote Attachment)

    P.S: 相关插件链接:
    Hacklog Remote Attachment Upyun
    http://github.ihacklog.com/hacklog-remote-attachment-upyun/
    --
    Hacklog Remote Attachment
    http://wordpress.org/plugins/hacklog-remote-attachment/
    --

    参考效果网站:shuge.org
    Mihuwa
        2
    Mihuwa  
       Aug 14, 2014 via iPhone
    @weiceng 楼主说的是前后分离,你这个好像是动静分离?
    weiceng
        3
    weiceng  
       Aug 14, 2014
    @Mihuwa
    好吧,仅供参考
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1106 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:25 · PVG 02:25 · LAX 11:25 · JFK 14:25
    ♥ Do have faith in what you're doing.