wordpress配置伪静态

wordpress配置伪静态

未配置伪静态的worpdress

image.png

浏览器端配置

image.png

nginx中配置

   vim /application/nginx/conf/extra/blog.conf

server {
    listen       80;
    server_name  blog.abc.com;
    location / {
        root   html/blog;
        index  index.php index.html index.htm;
        ##### wei jing tai ###
        if (-f $request_filename/index.html) {
          rewrite (.*) $1/index.html break;
        }
        if (-f $request_filename/index.php) {
          rewrite (.*) $1/index.php;
        }
        if (!-f $request_filename) {
          rewrite (.*) /index.php;
        }
    }
 
    #php jie xi
    location ~ .*\.(php|php5)?$ {
        root html/blog;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
}


重载nginx

   /application/nginx/sbin/nginx -t

   /application/nginx/sbin/nginx -s reload

mv /application/nginx/html/blog/index.html{,.bak}

浏览器访问检查

image.png



猜你喜欢

转载自blog.51cto.com/13673885/2173187