Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Nginx WordPress Permalink发行版_Php_Html_Wordpress_Nginx_Centos - Fatal编程技术网

Php Nginx WordPress Permalink发行版

Php Nginx WordPress Permalink发行版,php,html,wordpress,nginx,centos,Php,Html,Wordpress,Nginx,Centos,我有一个基于Nginx的VPS,上面有WordPress博客。这是百分之七 我对自定义永久链接有问题。 我当前的站点.conf如下所示 server { listen 80; server_name example.com www.example.com; # note that these lines are originally from the "location /" block root /var/www/example.com/ht

我有一个基于Nginx的VPS,上面有WordPress博客。这是百分之七

我对自定义永久链接有问题。 我当前的站点
.conf
如下所示

server {
    listen       80;
    server_name  example.com www.example.com;

    # note that these lines are originally from the "location /" block
    root   /var/www/example.com/html;
    index index.php index.html index.htm;

location / {
    try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|

ppt|tar|mid|midi|wav|bmp|rtf)$ {
       access_log off; log_not_found off; expires max;
}

# Uncomment one of the lines below for the appropriate caching plugin (if used).
#include global/wordpress-wp-super-cache.conf;
#include global/wordpress-w3-total-cache.conf;

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
我可以将permalink结构用作:
www.example.com/%post name%

我想像这样使用它:
www.example.com/download-%post name%-在线

当我保存我的自定义permalink结构并打开任何帖子时,permalink工作正常,即显示 www.example.com/download-whatsapp-online 在地址栏中,但实际显示的内容是主页

如果有人能纠正我的
.conf
错误,我会很高兴的。
谢谢干杯。

与php无关。@epodax Wordpress是php。。。您还需要一个web服务器来为您的PHP文件提供服务。它可以是Apache、Nginx、Lighttpd等。