Chive on nginx, htaccess

Hi, I am trying to configure chive on nginx, can someone help me convert htaccess for it?

Options +FollowSymLinks
IndexIgnore */*
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine on

    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # otherwise forward it to index.php
    RewriteRule . index.php?__chive_rewrite_on=1&%{QUERY_STRING}
    RewriteRule ^$ index.php?__chive_rewrite_on=1&%{QUERY_STRING}
</IfModule>
+3
source share
2 answers

If you installed chive in the "chive" subdirectory, follow these steps:

location /chive/ {
        try_files $uri chive/$uri/ /chive/index.php?q=$uri&$args;
}

without subdir:

location / {
# ... existing options ... check twice!
        try_files $uri $uri/ /index.php?q=$uri&$args;
}

you can use $ query_string instead of $ args, according to http://wiki.nginx.org/HttpCoreModule (It reads: "Same as $ args, except that this variable is read only.")

+6
source

Since then, an excellent project has appeared
https://github.com/perusio/chive-nginx

+1
source

Source: https://habr.com/ru/post/1775366/


All Articles