私はnginxに新しく、どのようにnginxで.htaccessを使用するのか分からず、nginx configuration.couldで生成されたコードをどこに置くのですか誰にもこれをnginxに変換するのを手伝ってください。どのようにnginxと.htaccessを使用してどこに置く?
はここでnginxのと場所を正確にこのコードを置くために私を導くために、これを変換するために私を助けてください、私の.htaccessファイル
<IfModule mod_rewrite.c>
RewriteCond ${REQUEST_URI} ^.+$
RewriteCond %{REQUEST_FILENAME} \.(admin)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule^- [L]
RewriteCond %{QUERY_STRING} [^a-z](cast|char|convert|declare|delete|drop|exec|insert|meta|script|select|set|truncate|update)[^a-z] [NC]
RewriteRule (.*) - [F]
RewriteEngine On
# redirect with username
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(admin|assets|include)(.*)?$ /$1$2 [L,QSA,R=301]
RewriteRule ^user/([a-zA-Z0-9_-]+)$ user.php?username=$1
RewriteRule ^user/([a-zA-Z0-9_-]+)/$ user.php?username=$1
RewriteRule ^media/([a-zA-Z0-9_-]+)$ media.php?id=$1
RewriteRule ^media/([a-zA-Z0-9_-]+)/$ media.php?id=$1
RewriteRule ^tag/([^/.]+)$ tag.php?tag=$1 [QSA,L]
RewriteRule ^tag/([^/.]+)/$ tag.php?tag=$1 [QSA,L]
# turn on the mod_rewrite engine
RewriteCond %{REQUEST_FILENAME}.php -f
# IF the request filename with .php extension is a file which exists
RewriteCond %{REQUEST_URI} !/$
# AND the request is not for a directory
RewriteRule (.*) $1\.php [L]
# redirect to the php script with the requested filename
</IfModule>
です。ありがとうございました!
nginxのは、(読み).htaccessファイルを使用するだけでええ – Mark
のapacheが、右nginxのためにhtaccessファイルを変換する方法はありませんか? –