I have this htaccess:

<IfModule mod_rewrite.c>

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*) index.php?%{QUERY_STRING} [L]

</IfModule>

to convert to nginx rules.

The problem is the last line.

Here is my current one :

  set $condition "";

  if (!-f $request_filename) {
    set $condition F;
  }
  if (!-d $request_filename) {
    set $condition "${condition}D";
  }
  if ($condition = FD) {
    rewrite ^(.*) $host/index.php?$query_string last;
  }

How can I make this work ?

Thank you.

link|improve this question
feedback

2 Answers

Just erased $host and kept / and it's ok.

link|improve this answer
feedback

try this:

location / {
    try_files $uri $uri/ /index.php?$args;
}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.