【发布时间】:2014-03-04 15:05:41
【问题描述】:
我正在尝试将 htaccess 规则转换为 nginx。我是 nginx 新手,在线转换器也无济于事。
在 www 文件夹中
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
在公用文件夹内
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
有人可以帮我将这些 htaccess 规则转换为 nginx 吗?
【问题讨论】:
-
当然。到目前为止,您尝试了什么,哪些没有按预期工作?您能否在您的 nginx 配置中添加相应的行,以便我们可以看到您所在的位置?
-
我对 nginx 完全陌生,但我尝试使用 link 进行转换,但它没有按预期工作。
-
那么请将结果添加到您的帖子中,并说明您的期望。对我来说,生成的结果看起来不错。
标签: apache .htaccess mod-rewrite nginx