2つの.htaccessファイルをnginxに変換しようとしています。一つ目はルートフォルダにあり、これが含まれています.htaccess to nginx:リライトまたは内部リダイレクトサイクル
RewriteRule ^install/?$ install/index.php [L]
RewriteRule ^freshadmin/?$ freshadmin/$1 [L]
RewriteRule ^i/?$ library/phpThumb/index.php$1 [L]
RewriteRule ^img/(.+).jpg$ image.php?n=productimage&var1=$1 [L]
RewriteRule ^recommends/([A-Za-z0-9-\+]+)/?$ linkfowarder.php?linkname=$1 [L]
RewriteRule ^([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ index.php?n=$1&var1=$2&var2=$3&var3=$4&var4=$5 [L]
RewriteRule ^([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ index.php?n=$1&var1=$2&var2=$3&var3=$4 [L]
RewriteRule ^([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-]+)/?$ index.php?n=$1&var1=$2&var2=$3 [L]
RewriteRule ^([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ index.php?n=$1&var1=$2 [L]
RewriteRule ^([A-Za-z0-9-\+]+)/?$ index.php?n=$1 [L]
RewriteCond %{DOCUMENT_ROOT}/$1 -f
RewriteCond %{REQUEST_URI} !^/min/
RewriteCond %{REQUEST_URI} !^/install/
RewriteRule ^(.+\.(css|js))$ /min/index.php?f=$1 [L,NE]
第二は/freshadmin/.htaccessに位置し、このようになりますされています。今、私はhttp://www.anilcetin.com/convert-apache-htaccess-to-nginx/でこれらを変換しようとした
RewriteRule ^styles/(.+)?$ templates/styles/$1 [L]
RewriteRule ^scripts/(.+)?$ templates/scripts/$1 [L]
RewriteRule ^icons/(.+)?$ templates/icons/$1 [L]
RewriteRule ^images/(.+)?$ templates/images/$1 [L]
RewriteRule ^ajax/(.+)?$ ajax/$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?controller=$1&action=$2&var1=$3&var2=$4&var3=$5&var4=$6 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?controller=$1&action=$2&var1=$3&var2=$4&var3=$5 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?controller=$1&action=$2&var1=$3&var2=$4 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?controller=$1&action=$2&var1=$3 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?controller=$1&action=$2 [L]
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?controller=$1 [L]
が、私は失われたtbhです。私が知っている
location /freshadmin/ {
index index.php index.html;
rewrite ^/freshadmin/styles/(.+)?$ /freshadmin/templates/styles/$1 last;
rewrite ^/freshadmin/scripts/(.+)?$ /freshadmin/templates/scripts/$1 last;
rewrite ^/freshadmin/icons/(.+)?$ /freshadmin/templates/icons/$1 last;
rewrite ^/freshadmin/images/(.+)?$ /freshadmin/templates/images/$1 last;
rewrite ^/freshadmin/ajax/(.+)?$ /freshadmin/ajax/$1 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1&action=$2&var1=$3&var2=$4&var3=$5&var4=$6 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1&action=$2&var1=$3&var2=$4&var3=$5 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1&action=$2&var1=$3&var2=$4 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1&action=$2&var1=$3 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1&action=$2 last;
rewrite ^/freshadmin/([A-Za-z0-9-]+)/?$ /freshadmin/index.php?controller=$1 last;
rewrite ^/freshadmin/?$ /freshadmin/$1 last;
}
location/{
index index.php index.html;
try_files $uri $uri/ @handler;
rewrite ^/install/?$ /install/index.php last;
rewrite ^/i/?$ /library/phpThumb/index.php$1 last;
rewrite ^/img/(.+).jpg$ /image.php?n=productimage&var1=$1 last;
rewrite ^/recommends/([A-Za-z0-9-\+]+)/?$ /linkfowarder.php?linkname=$1 last;
rewrite ^/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ /index.php?n=$1&var1=$2&var2=$3&var3=$4&var4=$5 last;
rewrite ^/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ /index.php?n=$1&var1=$2&var2=$3&var3=$4 last;
rewrite ^/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/([A-Za-z0-9-]+)/?$ /index.php?n=$1&var1=$2&var2=$3 last;
rewrite ^/([A-Za-z0-9-\+]+)/([A-Za-z0-9-\+]+)/?$ /index.php?n=$1&var1=$2 last;
rewrite ^/([A-Za-z0-9-\+]+)/?$ /index.php?n=$1 last;
if (-f $document_root/$1){
set $rule_10 1$rule_10;
}
if ($uri !~ "^/min/"){
set $rule_10 2$rule_10;
}
if ($uri !~ "^/install/"){
set $rule_10 3$rule_10;
}
if ($rule_10 = "321"){
rewrite ^/(.+\.(css|js))$ /min/index.php?f=$1 last;
}
}
location @handler {
rewrite//index.php;
}
location ~ \.php$ { ## Execute PHP scripts
if (!-e $request_filename) {
rewrite//index.php last;
} ## Catch 404s that try_files miss
expires off; ## Do not cache dynamic content
fastcgi_pass 127.0.0.1:9000;
#fastcgi_param HTTPS $fastcgi_https;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
、それはコードのかなりのですが、誰もがアイデアを得た場合、私は本当に感謝:これは私がこれまで持っており、それは私に500内部サーバーエラーを与えるものです! ありがとう