V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
youla
V2EX  ›  程序员

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

  •  
  •   youla · Dec 18, 2020 · 1102 views
    This topic created in 1958 days ago, the information mentioned may be changed or developed.
    <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
       Dec 18, 2020
    https://v2ex.com/t/736397

    昨天 iis 放弃了,应该是环境哪里有问题,再伸手
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1505 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:50 · PVG 00:50 · LAX 09:50 · JFK 12:50
    ♥ Do have faith in what you're doing.