我有以下的.htaccess文件我的Apache:
I've got the following .htaccess file for my apache:
<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-rewrite是行不通的。
Suddenly I had to change my webserver to nginx and I don't know why, but the mod rewrite is not working.
我用了一个网上转换器转换,所以我有以下几点:
I used an online 'converter' to convert it, so I've got the following:
location / { rewrite ^/$ / index.php break; if ($request_filename ~ !-f){ rewrite ^(.*)$ / index.php?page=$1 break; } }
你能不能帮我出了什么问题?
Could you help me what's wrong?
在此先感谢, 马塞尔·
Thanks in advance, Marcell
推荐答案blog.martinfjordvald/2011/02/nginx-primer-2-from-apache-to-nginx/ 一切都在里面。没有更多的.htaccess,没有更多的复杂的规则使用try_files。
blog.martinfjordvald/2011/02/nginx-primer-2-from-apache-to-nginx/ Everything is inside. No more .htaccess, no more complex rules use try_files.
修改:如果不是很明显,不信任的在线转换器
EDIT: And if it is not obvious, do not trust online converters.
更多推荐
转换的.htaccess nginx的(mod
发布评论