【发布时间】:2015-11-06 23:12:31
【问题描述】:
这些是我现有的 Apache htaccess 规则:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ myapp/webroot/ [L]
RewriteRule (.*) myapp/webroot/$1 [L]
</IfModule>
在这里阅读其他主题后,我在我的 nginx 服务器块配置中使用了这一行来启用重写:
location / {
root /var/www/example.com/html;
try_files $uri $uri/ /index.php$is_args$args;
}
所以基本的重写现在可以工作,但问题是,位于上述 apache 文件夹中的文件现在在根级别(不是从提到的文件夹)被调用,然后导致这些文件出现 404 错误。
如何将我的 Apache 规则正确导入到我的 nginx 配置中?
【问题讨论】:
标签: apache .htaccess mod-rewrite nginx