htaccess 到 nginx 的简单 url 重写转换
htaccess to nginx simple url rewrite conversion
我在过去 2 小时内尝试将以下 .htaccess 重写为 nginx,首先尝试了所有在线转换器但没有成功,还尝试查看转换示例但未在任何地方找到此转换:^system.*
如果有人能帮助我,我将不胜感激。
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
Apache 假定前导正斜杠。 Nginx 没有。
location ~* "^/system.*" {
try_files $uri /index.php$uri;
}
另外,不要使用那些在线转换器。在 Nginx 中有更好的处理文件存在的方法,但它们没有考虑到。看看这个:
我在过去 2 小时内尝试将以下 .htaccess 重写为 nginx,首先尝试了所有在线转换器但没有成功,还尝试查看转换示例但未在任何地方找到此转换:^system.*
如果有人能帮助我,我将不胜感激。
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
Apache 假定前导正斜杠。 Nginx 没有。
location ~* "^/system.*" {
try_files $uri /index.php$uri;
}
另外,不要使用那些在线转换器。在 Nginx 中有更好的处理文件存在的方法,但它们没有考虑到。看看这个: