阿里云nginx,wordpress站点如何配置伪静态

小编这里用的是阿里云liunx一键摆设,究竟结果也是小白,也是碰到此类问题,而网上良多都不克不及当作功,最后花了不少时候连系一些常识最终试探解决。大师问题解决记得点个攒哦~

东西/原料

  • Xshell
  • 网站后台操作

方式/步调

  1. 1

    打开wordpress后台设置里的固心猿意马链接,点窜为 /%post_id%.html如下图:

  2. 2

    打开办事器进入cd /alidata/server/nginx/conf/vhosts/,点窜对应的wordpress站点的.conf文件。小编这里是wordpress.conf如图输入即可!

  3. 3

    对应以下输入点窜或添加

    server {

            listen       80;

            server_name  域名;

            index index.html index.htm index.php;

            root 站点地点的目次;

            location / {

            try_files $uri $uri/ /index.php?$args;

            }

            location ~ .*\.(php|php5)?$

            {

                    #fastcgi_pass  unix:/tmp/php-cgi.sock;

                    fastcgi_pass  127.0.0.1:9000;

                    fastcgi_index index.php;

                    include fastcgi.conf;

            }

            location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

            {

                    expires 30d;

            }

            location ~ .*\.(js|css)?$

            {

                    expires 1h;

            }

            #伪静态设置路径 和日记文件路径

            include /etc/nginx/rewrite/default.conf;

            access_log  /var/log/nginx/wordpress.log;

    确定:   按ESC  输入 :wq 回车冒号也输!

  4. 4

    最后重启nginx,输入service nginx restar 回车。

  5. 5

    以上竣事wordpress站点后台、页面就能正常操作了。

注重事项

  • 注重不要输错
  • 不要健忘重启nginx办事器
  • 发表于 2018-03-13 00:00
  • 阅读 ( 1019 )
  • 分类:其他类型

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
admin
admin

0 篇文章

作家榜 »

  1. xiaonan123 189 文章
  2. 汤依妹儿 97 文章
  3. luogf229 46 文章
  4. jy02406749 45 文章
  5. 小凡 34 文章
  6. Daisy萌 32 文章
  7. 我的QQ3117863681 24 文章
  8. 华志健 23 文章

联系我们:uytrv@hotmail.com 问答工具