Apache htaccess -> Nginx 重写

Apache htaccess -> Nginx 重写

请帮助我编写 nginx 重写而不是 Apache htaccess:

 Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /


  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)([^/])$ $1$2/ [R,L]

  RewriteCond %{ENV:REDIRECT_RDR} ^$
  RewriteCond %{HTTP_HOST} ^(.+)\.site\.com$
  #RewriteCond %2 !www
  RewriteCond %{HTTP_HOST} !^www\.site\.com$
  RewriteRule ^([a-zA-Z0-9`~!@#$%^&()\-+";=\\/|]*)$ blogs/fake/%2/$1 [L,E=RDR:1]


  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !/urlrewriteprepend.php$
  RewriteRule ^(.*)$ /urlrewriteprepend.php [L]

答案1

以下是nginx HttpRewriteModule 文档- 您需要了解的所有内容都应在此文档中提供。

相关内容