• discuz X2 +Ubuntu+nginx的伪静态配置


     sudo vi /usr/local/nginx/conf/nginx.conf

    打开配置文件,找到所需要配置的server,添加伪伪静态

        server {
            listen       80;
            server_name  localhost;
            #charset koi8-r;
            #access_log  logs/host.access.log  main;
            location / {
                root   /var/www/;
                index  index.php index.html index.htm;
                rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
                rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
                rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
                rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
                rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
                rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
                rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
                rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
                rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
                if (!-e $request_filename) {
                   return 404;
                   }

            } 

    重启nginx

    之后在discuz的配置管理中心打开伪静态,全局/SEO/URL静态化,把需要伪静态化的打上勾。

  • 相关阅读:
    cubestore driver 添加auth认证
    cubestore 添加auth 认证
    基于s3 扩展cubestore
    cube.js 预聚合检查
    cube.js 集成cubestore 时间格式问题的一些说明
    cube.js 集成cubestore 时间格式问题
    Building a GraphQL to SQL Compiler on Postgres, MS SQL and MySQL
    支持minio cubestore docker 镜像
    数据治理怎么做
    使用project制定项目计划可以分为六个步骤
  • 原文地址:https://www.cnblogs.com/conan304/p/2178161.html
Copyright © 2020-2023  润新知