存档

文章标签 ‘rewrite’

wordpress 伪静态 windows主机下

2009年10月11日 没有评论

win主机对wordpress伪静态支持不太好,网上找了一些,有说用404实现,有说改写httpd.ini.但都有一个问题.就是对文章提交评论的时候,会出现404无法找到..

今天找了一个.可以解决评论出现404页面的问题.其他的暂未发现.

发出来分享下. 效果可以看 http://www.lilijun.cn
[ISAPI_]
# Defend your computer from some worm attacks

阅读全文…

wordpress在nginx下rewrite静态化规则

2009年8月23日 没有评论

在nginx不能像apache加入.htaccess实现静态化。
apache下

  1. # BEGIN WordPress
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteCond %{REQUEST_FILENAME} !-d
  7. RewriteRule . /index.php [L]
  8. </IfModule>
  9. # END WordPress

nginx在vhost配置中加入

  1. location / {
  2.         index index.html index.php;
  3.         if (-f $request_filename/index.html){
  4.             rewrite (.*) $1/index.html break;
  5.         }
  6.         if (-f $request_filename/index.php){
  7.             rewrite (.*) $1/index.php;
  8.         }
  9.         if (!-f $request_filename){
  10.             rewrite (.*) /index.php;
  11.         }
  12.     }
分类: √web 标签: , ,