V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hiboshi
V2EX  ›  Apache

请教一个重写规则问题

  •  
  •   hiboshi · 2017-03-25 12:25:35 +08:00 · 1696 次点击
    这是一个创建于 2588 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    2017-03-25 14:08:50 +08:00
    hiboshi
        1
    hiboshi  
    OP
       2017-03-25 14:08:50 +08:00
    已经解决
    加上
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5609 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:10 · PVG 11:10 · LAX 20:10 · JFK 23:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.