简体   繁体   English

Nginx帮助Wordpress自定义永久链接重写

[英]Nginx Help Wordpress Custom Permalink Rewrite

Nginx Help Wordpress Custom Permalink Rewrite problem. Nginx帮助Wordpress自定义永久链接重写问题。

Test site : http://unknown/blog/ Post link : http://unknown/blog/archives/2604.html(404 error) 测试站点: http:// unknown / blog /帖子链接: http://unknown/blog/archives/2604.html(404错误)

My permalink settings is '/archives/%post_id%.html' 我的永久链接设置为“ /archives/%post_id%.html”

index.php?$args . index.php?$ args。 args is not '.html' recognition. args不是'.html'识别。

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

$args is possible '/archives/%post_id%' is not possible '/archives/%post_id%.html' $ args可能是'/ archives /%post_id%'不可能'/archives/%post_id%.html'

my all posting link is '.html' i need help ! 我所有的发帖链接都是“ .html”,我需要帮助!

Another method set permalink '/archives/%post_id%' 设置永久链接'/ archives /%post_id%'的另一种方法

user connect in post ' http://unknown/blog/archives/2604.html ' (search in google) redirect -> ' http://unknown/blog/archives/2604 ' 用户在帖子中连接' http://unknown/blog/archives/2604.html '(在Google中搜索)重定向->' http:// unknown / blog / archives / 2604 '

possible? 可能?

Oh my god. 哦,我的上帝。 this problem is solved. 这个问题解决了。

my mistake. 我的错。

im used the Caching 我使用了缓存

location ~* \.(html|htm|txt)$ {
    #add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    access_log off;
    expires 1d;
    break;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM