1

Help me please to write nginx rewrites instead of that 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

Here is a link to the nginx HttpRewriteModule documentation - everything you need to know should be available in this document.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy