chanue
V2EX  ›  问与答

htaccess一个转向的问题

  •  
  •   chanue · May 2, 2011 · 6238 views
    This topic created in 5674 days ago, the information mentioned may be changed or developed.
    例如直接访问http://www.domain.com/xxx.zip 想让其301永久转到http://www.domain.com/ 该怎么写
    4 replies  •  1970-01-01 08:00:00 +08:00
    phzzy
    phzzy
    May 2, 2011
    1
    RewriteRule ^xxx.zip$ http://www.domain.com/ [L,R=301]
    chanue
    chanue
    OP
    May 2, 2011
    2
    @phzzy 能不能有一个通配符,让所有访问zip文件都跳转
    yesmeck
    yesmeck
    May 2, 2011
    3
    1L点没转义掉额~

    RewriteRule ^.*\.zip$ http://www.domain.com/ [L,R=301]
    phzzy
    phzzy
    May 2, 2011
    4
    RewriteRule ^.*\.zip$ http://www.domain.com/ [L,R=301]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1037 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:01 · PVG 07:01 · LAX 15:01 · JFK 18:01
    ♥ Do have faith in what you're doing.