Nginx伪静态php设置方法

2025-04-16 19:03:12
推荐回答(2个)
回答1:

修改/etc/nginx/nginx.conf,tae的话可能在conf.d里边的virtual.conf,在server里边添加伪静态规则

location / {
        index  index.php index.html index.htm;
        rewrite ^(.*)/item/([0-9]+)\.html $1/item.php?id=$2 last;
    }

大概是这样,规则要自己测试

回答2:

wordpress网站设定伪静态有益于seo优化,而且有益于百度搜索引擎网络爬虫浏览,提升网址文章内容百度收录的速率。下边我共享一下wordpress网站伪静态设定的方式。