V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
s609926202
V2EX  ›  问与答

被 nginx 伪静态搞疯了,,

  •  
  •   s609926202 · 2017-06-16 15:45:19 +08:00 · 1346 次点击
    这是一个创建于 2713 天前的主题,其中的信息可能已经有所发展或是发生改变。

    网站只提供了.htaccess,但是服务器是 nginx serve,所以要 convert, 一下是.htaccess 内容:

    RewriteEngine On RewriteBase / RewriteRule ^(uploads/.?_\d+x\d+.(jpg|gif|png|jpeg))$ /image/index.php?$1 [L] <Files .> Order Deny,Allow Deny From All </files> RewriteRule ^(?:v5|modules|system)\b.* index.php/$0 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/(uploads|public|newtravel|phone|payment)(/)? RewriteRule .* index.php/$0 [PT]

    求助懂得 Nginx rewrite 的给出 convert 后的配置

    2 条回复    2017-06-16 15:47:50 +08:00
    s609926202
        1
    s609926202  
    OP
       2017-06-16 15:45:31 +08:00
    # Turn on URL rewriting
    RewriteEngine On

    # Installation directory
    RewriteBase /
    #mobile start
    #mobile end
    RewriteRule ^(uploads/.*?_\d+x\d+\.(jpg|gif|png|jpeg))$ /image/index.php?$1 [L]

    # Protect hidden files from being viewed
    <Files .*>
    Order Deny,Allow
    Deny From All
    </Files>


    # Protect application and system files from being viewed
    RewriteRule ^(?:v5|modules|system)\b.* index.php/$0 [L]

    # Allow any files or directories that exist to be displayed directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/(uploads|public|newtravel|phone|payment)(/)?
    #RewriteCond %{REQUEST_FILENAME} !-d
    # Rewrite all other URLs to index.php/URL
    RewriteRule .* index.php/$0 [PT]
    ahu
        2
    ahu  
       2017-06-16 15:47:50 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2774 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:23 · PVG 23:23 · LAX 07:23 · JFK 10:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.