Nginx配置Restful风格url
2016-03-03 23:09
585 查看
开始做seo的优化,当然牵扯到固定链接,wordpress提供多种类型的链接形式:
我选择了/%postname%伪静态,虽然现在貌似没什么差别了,但还是该下吧。下面就出现了修改固定链接后,访问文章会出现404错误。wordpress官方给出了新的开启固定链接的方法,非常简单的。将下列代码粘贴到nginx的conf配置文件里。
接着重启nginx就可以正常访问了!!!
原文地址:http://wanshicheng.org/nginx%E9%85%8D%E7%BD%AErestful%E9%A3%8E%E6%A0%BCurl/
1234567 | /%year%/%monthnum%/%day%/%postname%//%year%/%monthnum%/%postname%//%year%/%monthnum%/%day%/%postname%.html/%year%/%monthnum%/%postname%.html/%category%/%postname%.html/%post_id%.html/%postname%/ |
1 2 3 4 | location / { try_files $uri $uri/ /index.php?$args; } rewrite /wp-admin$ $scheme://$host$uri/ permanent; |
原文地址:http://wanshicheng.org/nginx%E9%85%8D%E7%BD%AErestful%E9%A3%8E%E6%A0%BCurl/
相关文章推荐
- nginx上搭建HLS流媒体服务器
- LNMP第二部分nginx、php配置
- nginx配置文件nginx.conf解读
- 发现一个nginx LUA开发Web App的框架
- Scaling CloudFlare’s Massive WAF
- centos6 yum 安装nginx 不成功解决办法
- nginx 同一端口根据不同域名转发到不同端口
- Nginx+CI出现404错误
- Nginx+CI出现404错误
- Nginx配置文件各配置项详细说明
- ubuntu下的nginx+php配置与常见问题
- CORS其实很简单:NGINX 一招搞定针对特定域名和端口跨域,动态决定跨域到哪里
- nginx location匹配
- nginx-1.5.10 之mips编译到RT5350
- nginx的配置系统
- 快速部署Python应用:Nginx+uWSGI配置详解
- (总结)Nginx配置文件nginx.conf中文详解
- Linux下安装Nginx1.9.3-0303(本人亲手实践)
- 解决nginx负载均衡的session共享问题
- Nginx入门笔记_第一篇