免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3335 | 回复: 4
打印 上一主题 下一主题

[Web] 求一段APACHE转NGINX的伪静态规则。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-22 00:18 |只看该作者 |倒序浏览
20可用积分
原APACHE规则如下:
<IfModule mod_rewrite.c>
        RewriteEngine On
        # If your server is running PHP in CGI mode you will probably need to uncomment the following lines
        # Only uncomment lines that begine with Rewrite

        # The RewriteBase should be set to the same value as the AppPath setting in your config.php WITH a / on the end
        # RewriteBase /

        # This rewrite base rule is only required if you are getting 401 unauthorized errors when placing an order with Google Checkout
        RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . index.php
        <IfModule mod_env.c>
                SetEnv SEO_SUPPORT 1
        </IfModule>
</IfModule>

<IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>


求上面转化为NGINX的伪静态规则。谢谢。

论坛徽章:
0
2 [报告]
发表于 2009-04-22 00:18 |只看该作者
       ......
       location / {
            index  index.php;
            if (!-f $request_filename){
                rewrite ^/(.+)$ /index.php?$1& last;
            }
        }

论坛徽章:
0
3 [报告]
发表于 2009-04-22 11:13 |只看该作者
就几句转换,20分不是嫌少吧。。。。

论坛徽章:
0
4 [报告]
发表于 2009-04-23 11:23 |只看该作者
不会吧。大哥大姐们,帮下忙啊。20分了都

论坛徽章:
0
5 [报告]
发表于 2009-04-26 02:05 |只看该作者

回复 #4 benqktc 的帖子

虽然不是完全可以。但基本上可以了。谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP