chanue
V2EX  ›  问与答

htaccess一个转向的问题

  •  
  •   chanue · May 2, 2011 · 5869 views
    This topic created in 5522 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
        1
    phzzy  
       May 2, 2011
    RewriteRule ^xxx.zip$ http://www.domain.com/ [L,R=301]
    chanue
        2
    chanue  
    OP
       May 2, 2011
    @phzzy 能不能有一个通配符,让所有访问zip文件都跳转
    yesmeck
        3
    yesmeck  
       May 2, 2011
    1L点没转义掉额~

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