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

请教 apache .htaccess 相关,vue history mode.

  •  
  •   youla · 2020-12-18 11:49:30 +08:00 · 642 次点击
    这是一个创建于 1222 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.html$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} example [NC]
      RewriteRule . /index.html [L]
      
      #hide .php
      
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^([^\.]+)$ $1.php [NC,L]
    </IfModule>
    
    # 我的 vue-router 里面配置的都是 example_xx 形式
    
    # 昨天的搞不定 https://v2ex.com/t/736397 直接把 iis 换成 apache 了
    
    # 再伸手
    
    # 看起来基本没问题了,用·CURL·测试了多次
    
    

    但是我现在的配置文件里面 page.php -> page 失效了
    Google 了好多次,难以理解这个配置文件到底怎么写,
    在线测试工具也搞的头疼,伸手。

    youla
        1
    youla  
    OP
       2020-12-18 11:58:05 +08:00
    https://v2ex.com/t/736397

    昨天 iis 放弃了,应该是环境哪里有问题,再伸手
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5397 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:20 · PVG 15:20 · LAX 00:20 · JFK 03:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.