wordpress设置伪静态及设置后出现问题
2017-08-25 14:41
253 查看
一、如何设置给wordress设置伪静态?
在workpress后台中设置-固态链接-自定义结构,输入/%post_id%.html,你再去看自己文章的链接,后面会多了html的后缀,就算是设计成功了
二、设置了伪静态后,出现了404not found nginx
可能每种情况的处理方式是不同的,我这情况就是原先wordpress的配置不够完整
在你原先的服务器里找到wordpress.conf ,这个文件我的路径是usr/local/nginx/conf 里
然后把以下内容覆盖原来里面的内容,有些内容需要自己稍作修改:
在workpress后台中设置-固态链接-自定义结构,输入/%post_id%.html,你再去看自己文章的链接,后面会多了html的后缀,就算是设计成功了
二、设置了伪静态后,出现了404not found nginx
可能每种情况的处理方式是不同的,我这情况就是原先wordpress的配置不够完整
在你原先的服务器里找到wordpress.conf ,这个文件我的路径是usr/local/nginx/conf 里
然后把以下内容覆盖原来里面的内容,有些内容需要自己稍作修改:
server { listen xxxx; //端口 server_name xxxxx.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/xxxx/wordpress; include none.conf; #error_page 404 /404.html; location ~ [^/]\.php(/|$) { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location / { if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } }覆盖之后,重启一次nginx,然后再去访问你带有html后缀的文章就可以访问了
相关文章推荐
- centos6.5配置静态IP 时,出现BCAST不能设置的问题
- wordpress 在Nginx服务器设置固定链接后出现404问题
- Web.config设置Form页面跳转出现问题
- 关于Socket 设置 IPAddress.Any 情况下,出现服务器积极拒绝的问题
- SQL Server2008 备份“已注册的服务器”设置,以及出现导入失败问题的解决办法
- 关于UILabel设置AttributedString以后末尾...不出现的问题
- 设置Android studio出现的问题
- 未将对象引用设置到对象的实例--可能出现的问题总结
- Extjs的textfield的颜色设置和出现的问题笔记
- textview中有很多行,我只让它显示三行,最后显示...,我设置了android:maxLines="3"和android:ellipsize="end",但出现的问题是只显示两行就显示“...”
- Volley 设置setRetryPolicy中Retry 为0后 还出现重复连接的问题
- java web,charset编码设置正确情况下出现部分中文正常,部分中文乱码的问题
- MFC 在类中声明其他类的静态对象出现的问题ATPC.obj : error LNK2001 和&nbs
- 关于app更新安装闪退和EditText长按出现的水滴颜色设置问题
- udig设置样式在Geoserver使用出现汉字乱码问题
- 使用wordpress的$wpdb类读mysql数据库做ajax时出现的问题及解决
- 【ASP.NET 问题】IIS发布网站后出现“检测到在集成的托管管道模式下不适用的ASP.NET设置”的解决办法
- jquery下动态显示jqGrid以及jqGrid的属性设置容易出现问题的解决方法
- 未将对象引用设置到对象的实例--可能出现的问题总结
- iis6应用程序池被自动禁用问题 Service Unavailable 应用程序池 'DefaultAppPool' 被自动禁用,原因是为此应用程序池提供服务的进程中出现一系列错误。应用程序-特定 权限设置未将 COM 服务器应用程序(CLSID 为