VPS侦探论坛

 找回密码
 注册
查看: 6204|回复: 4

nginx+wordpress返回的页面链接为IP(wordpress 更改更换域名)

[复制链接]
发表于 2014-2-24 22:43:04 | 显示全部楼层 |阅读模式

貌似很少有人遇到这个问题:http://blog.77hz.cn/,文章的链接都是IP。
配置如下,兄弟们给看看:
server {
        listen       80;
        server_name  blog.77hz.cn;
                root  /home/wwwroot/wordpress;
        #charset koi8-r;

        access_log  /home/wwwlogs/access.log  access;
               
                include wordpress.conf;

                location ~ .*.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*.(js|css)?$
                        {
                                expires      12h;
                        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ .php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ .php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /.ht {
        #    deny  all;
        #}
    }

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2014-2-24 23:26:32 | 显示全部楼层

回复 1# 的帖子



现在用以下的配置先搞定了,想问下有没有方法不用加下面的配置也可以

                sub_filter 115.29.243.174 'blog.77hz.cn';
                sub_filter_once off;
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2014-2-25 08:42:58 | 显示全部楼层

你那是用ip安装的wordpress吧
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2014-2-25 15:32:32 | 显示全部楼层

回复 3# 的帖子




对,对wp不是很了解,想不到还跟这个有关,谢谢提醒。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2014-2-25 18:32:30 | 显示全部楼层

找到wp-config.php,在wp-config.php中,添加:
define('WP_HOME','https://www.vpser.net');
define('WP_SITEURL','https://www.vpser.net');
其中www.vpser.net替换为你的域名
或用下面的这个
define('RELOCATE',true);
登陆wp后台,设置->常规 中 更新成你的新域名
最后都要删除在wp-config.php中刚才添加的内容。

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 11:21 , Processed in 0.027235 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表