• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ByteCat
V2EX  ›  程序员

求帮助, Apache 重写规则的写法

  •  
  •   ByteCat · Jun 22, 2020 · 2199 views
    This topic created in 2192 days ago, the information mentioned may be changed or developed.
    访问 Apache 服务器( www.aaa.com )时,当遇到形如 `https://www.aaa.com/user/10000` 的链接时,跳转到 `https://www.bbb.com/?user=10000`,虽然确实是很简单的需求,但对 Apache 的重写规则不熟悉,还请 V 友们帮帮忙了,谢谢!
    (使用 `.htaccess` 文件)
    1 replies    2020-06-22 09:07:58 +08:00
    MrUser
        1
    MrUser  
       Jun 22, 2020
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^user/([0-9]+)$ ?user=$1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   902 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:36 · PVG 05:36 · LAX 14:36 · JFK 17:36
    ♥ Do have faith in what you're doing.