doudou0111 2017-10-24 20:58 采纳率: 0%
浏览 64

提供静态内容 - Wordpress无Cookie子域

I've followed this guide to the brim, but on step 3 I'm being stumped.

I've declared the following in the wp-config.php (customized to my domain):

define("WP_CONTENT_URL", "http://static.domainname.com");
define("COOKIE_DOMAIN", "www.domainname.com");
define("WP_PLUGIN_URL", "http://static.domainname.com/plugins");

And I've gone in phpMyAdmin in cPanel and done this update:

UPDATE wp_posts SET post_content = REPLACE(post_content,
 'http://www.domainname.com/wp-content/uploads/','http://static.domainname.com/uploads/')

However, I get this result:

0 rows affected phpMyAdmin

When I update new content, the images get prepended "static," which is good, but my stylesheets also have "static," and since there's no content loaded on that subdomain, my site gets wrecked. And all existing images need to be uploaded to the subdomain so they are also served via "static."

Am I following the guide above wrongly?

  • 写回答

1条回答 默认 最新

  • dtkwt62022 2018-01-09 15:59
    关注

    If you've stumbled upon this, I forgot to keep

    SELECT * FROM `wp_posts` 
    

    above the update posts.

    In final, the phpMyAdmin would look like:

    SELECT * FROM `wp_posts`;
    UPDATE wp_posts SET post_content = REPLACE(post_content,
     'http://www.domainname.com/wp-content/uploads/','http://static.domainname.com/')
    
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改