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

请教大佬写一个 apache rewrite 的实现

  •  
  •   fengzl · Apr 7, 2023 · 1312 views
    This topic created in 1128 days ago, the information mentioned may be changed or developed.

    如题,想要实现 http://test.com/a/b 重定向到 http://test.com/?type=a&val=b 这样的实现,用的 apache 服务器,想要写一个 rewrite 实现这样的需求应该怎么写,谢谢大佬

    defunct9
        1
    defunct9  
       Apr 7, 2023
    RewriteRule ^a/b$ results.php?type=a&val=b [QSA]
    defunct9
        2
    defunct9  
       Apr 7, 2023
    RewriteRule ^([A-Za-z0-9]+)/([A-Za-z0-9]+) ?type=$1&val=$2 [QSA]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3142 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 03:17 · PVG 11:17 · LAX 20:17 · JFK 23:17
    ♥ Do have faith in what you're doing.