如何在URL中删除帖子页号

问题描述 投票:0回答:1

我正在使用Wordpress,而wordpress具有此功能,可让您将单个帖子分成多个页面。

[我现在遇到的问题是,当用户导航到第2页时,URL将变为www.domain.com/post-title/2/,而不是停留在www.domain.com/domain-title/。] >

请澄清一下,由于我在较长的帖子中使用了下一页的简码,所以对于1个帖子,我会说...几个页面,如:

http://www.domain.com/post1/ http://www.domain.com/post1/1/ http://www.domain.com/post1/2/ http://www.domain.com/post1/3/

而且我希望无论在哪个帖子页面上,它都只读http://www.domain.com/post1/。>

我正在使用Nginx btw。谢谢!

我正在使用Wordpress,而wordpress具有此功能,可让您将单个帖子分成多个页面。我现在遇到的问题是,当用户导航到页面2时,URL将...

wordpress nginx rewrite
1个回答
0
投票

这是我的Nginx wordpress配置

server {
        listen 80;
        server_name domain.com;
        server_tokens   off;
        root /path/to/root;
        access_log /var/log/nginx/wordpress_access.log;
        error_log /var/log/nginx/wordpress_error.log;
        index index.php;
        charset utf-8;
        gzip on;
        gzip_disable "msie6";

        location / {
                try_files $uri /index.php$request_uri;
        }
        location ~ \.php {
                include fastcgi_params;
                # change according to ur sock/port 
                fastcgi_pass   unix:/var/run/php5-fpm.sock;
        }
        location ~ /\.ht {
                deny all;
        }
}
© www.soinside.com 2019 - 2024. All rights reserved.