title: HTACCESS 2 NGINX Rule,any can help me?
body: <p>i have one site need to move from apache2 to nginx,everything is ok ,except the htaccess. i have google some online tools (<a href="http://www.anilcetin.com/convert-apache-htaccess-to-nginx/" rel="nofollow">http://www.anilcetin.com/convert-apache-htaccess-to-nginx/</a> &amp; <a href="http://winginx.com/en/htaccess" rel="nofollow">http://winginx.com/en/htaccess</a> ... ),but they all didn't work, even one rule :( !</p>
  
  <p>anyone can help me ,thank you!!!</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  
  #First rewrite any request to the wrong domain to use the correct one (here www.)
  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  #Now, rewrite to HTTPS:
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteCond %{REQUEST_URI} !^/index.php$
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  &lt;IfModule mod_php5.c&gt;
      php_flag magic_quotes_gpc         off
      php_flag magic_quotes_runtime     off
  &lt;/IfModule&gt;
  &lt;IfModule mod_php4.c&gt;
      php_flag magic_quotes_gpc         off
      php_flag magic_quotes_runtime     off
  &lt;/IfModule&gt;
  </code></pre>