hiboshi
V2EX  ›  Apache

请教一个重写规则问题

  •  
  •   hiboshi · Mar 25, 2017 · 2262 views
    This topic created in 3341 days ago, the information mentioned may be changed or developed.
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^(/aaa/bbb)$ [NC]
    RewriteCond %{SERVER_PORT} =80  [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [NC,L,R=301]
    RewriteRule !\.(dfk|tsv|pdf|PDF|js|ico|gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG|css|src|csv|txt|TXT|xml|XML|xls|XLS|php|PHP|json|ttf|woff|woff2|svg|swf|eot|htc|lic|mp4)$ index.php [NC,L]
    

    当我使用 80 端口并且 URI 不为 /aaa/bbb 的时候 不跳转 https

    这样写怎么直接跳到 https://www.test.com/index.php 上面了?

    1 replies    2017-03-25 14:08:50 +08:00
    hiboshi
        1
    hiboshi  
    OP
       Mar 25, 2017
    已经解决
    加上
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1774 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:17 · PVG 00:17 · LAX 09:17 · JFK 12:17
    ♥ Do have faith in what you're doing.