Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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]
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.