【发布时间】:2013-02-02 08:17:26
【问题描述】:
我的 apache 有以下 .htaccess 文件:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteRule ^$ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?page=$1 [QSA,L]
</IfModule>
突然间我不得不将我的网络服务器更改为 nginx,我不知道为什么,但是 mod 重写不起作用。
我使用了一个在线“转换器”来转换它,所以我得到了以下内容:
location / {
rewrite ^/$ / index.php break;
if ($request_filename ~ !-f){
rewrite ^(.*)$ / index.php?page=$1 break;
}
}
你能帮我看看有什么问题吗?
提前致谢, 马塞尔
【问题讨论】:
-
哪个白痴关闭了这个?大多数网站都需要在从 Apache 而不是 nginx 迁移时更新 mod 重写规则。
标签: apache .htaccess mod-rewrite nginx