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

 时间:2026-02-12 17:11:27

1、打开wordpress后台设置里的固定链接,修改为 /%post_id%.html如下图:

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

2、打开服务器进入cd /alidata/server/nginx/conf/vhosts/,修改对应的wordpress站点的.conf文件。小编这里是wordpress.conf如图输入即可!

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

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 回车冒号也输!

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

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

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

5、以上结束wordpress站点后台、页面就能正常操作了。

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

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

  • nginx服务器如何配置wordpress博客伪静态
  • 阿里云服务器怎么连接
  • wordpress的nginx与php配置
  • WordPress 开启多站点 Apache和Nginx伪静态规则
  • 阿里云如何正确解析域名
  • 热门搜索
    宝宝长痱子怎么办 手机怎么截图 怎么炖鱼 怎么写周记 马騳骉怎么读 外域怎么去 肾疼是怎么回事 plate怎么读 vcf文件怎么打开 眼睛散光怎么办