php - WordpressNGINX not respecting the category URL for new posts

Only recently noticed this issue with my site configurations, it seems as though on my NGINX Wordpress sites the categor

Only recently noticed this issue with my site configurations, it seems as though on my NGINX Wordpress sites the category base of a URL is not being respected and instead being redirected to another category which uses the same post_name slug as the new post. This results in me unable to make any unique name posts since it's ignoring the category base entirely!

I'm not entirely sure why this is the case and would love if someone could help with this. Details below.

An example expected scenario

=> will go to /category-1/post-1 => will go to /category-2/post-1

Current scenario

=> will go to /category-1/post-1 => will go to /category-1/post-1

Any new posts will produce the following

=> post exists at /category-1/post-1 => new post created with exists at /category-2/post-1-2 extension

My settings in the permalinks for Wordpress

My NGINX configurations for /location is below

    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    # break if URI has .html extension
    if ($request_filename ~* ^.+.html$) {
      break;
    }
    # add .html to URI and serve file, directory, or symlink if it exists
    if (-e $request_filename.html) {
      rewrite ^/(.*)$ /$1.html last;
      break;
    }


    try_files $uri $uri/ /index.php?q=$uri&$args; 

#   try_files $uri $uri/ =404;

}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745362653a4624429.html

相关推荐

  • php - WordpressNGINX not respecting the category URL for new posts

    Only recently noticed this issue with my site configurations, it seems as though on my NGINX Wordpress sites the categor

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信