wordpress在不同webserver下的重写规则和配置

作者 : admin 于 2009年04月07日, 21:22:07
2009
04-7

apache下

  1. #.htaccess
  2. RewriteEngine On
  3. RewriteBase /
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteRule . /index.php [L]
  7. #httpd.conf
  8. Options ExecCGI FollowSymLinks
  9. AllowOverride All
  10. Order allow,deny
  11. allow from all

nginx下

  1. #nginx.conf
  2. location / {
  3.         if (!-f $request_filename){
  4.             rewrite (.*) /index.php;
  5.         }
  6.     }

Nginx下WordPress的重写配置

作者 : admin 于 2008年05月18日, 12:30:14
2008
05-18

nginx居然不兼容apache的.htaccess文件,无奈在配置文件中修改.

server
{
listen  80;

location / {
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}

server_name sunboyu.cn www.sunboyu.cn *.sunboyu.cn somecode.cn www.somecode.cn *.somecode.cn;
index   index.html index.htm index.php;
root    /***/;
access_log  /***/host.access.log;
}

这样即可