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.     }

评论 3

  1. peacock Says:

    博主,你好,请问如果要过滤掉css和js文件,也就是说,css和js文件不进行rewrite到index.php,请问要怎么写nginx的rewrite?

    麻烦把rewrite规则发送到我的邮箱,谢谢!

  2. cool Says:

    AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
    Options -ExecCGI

    老大,这个如何转成nginx的规则。先谢谢了。

  3. admin Says:

    这个得配置,不是规则

发表评论




XHTML:你可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(若看不到验证码,请重新加载页面。)