1. 论坛系统升级为Xenforo,欢迎大家测试!
    Dismiss Notice

问一个 .htaccess 规则问题

Discussion in '主机讨论' started by f, Oct 30, 2009.

  1. f

    f New Member

    Joined:
    Apr 8, 2006
    Messages:
    641
    Likes Received:
    0
    现有网址是 /cat/0/1.htm ,要转向到 /cat/0/1.html ,可以怎么写规则呢?

    另外如果要将 /a/b/c/0/1.html 转向到 /d/0/1.html ,又该如何写呢?

    谢谢!
     
  2. A君

    A君 Well-Known Member

    Joined:
    Aug 31, 2005
    Messages:
    19,987
    Likes Received:
    98
    不懂。
     
  3. 酋长

    酋长 New Member

    Joined:
    Oct 5, 2006
    Messages:
    2,546
    Likes Received:
    8
    不告诉你。
     
  4. laogui

    laogui Administrator
    Staff Member

    Joined:
    Aug 30, 2005
    Messages:
    15,216
    Likes Received:
    35
    Redirect permanent /cat/0/1.htm /cat/0/1.html
     
  5. junp

    junp New Member

    Joined:
    Nov 6, 2005
    Messages:
    1,259
    Likes Received:
    4
    RewriteRule ^cat/(\d+)/(\d+).htm$ /cat/$1/$2.html [L]
     
  6. f

    f New Member

    Joined:
    Apr 8, 2006
    Messages:
    641
    Likes Received:
    0
    此问题解决。

    谢谢大家,尤其是 junp 。

    :)
     
  7. laogui

    laogui Administrator
    Staff Member

    Joined:
    Aug 30, 2005
    Messages:
    15,216
    Likes Received:
    35
    junp是高手啊。
     
  8. f

    f New Member

    Joined:
    Apr 8, 2006
    Messages:
    641
    Likes Received:
    0
    我只知道他幫我解決了好幾個問題。

    你就差遠了……

    :D
     
  9. junp

    junp New Member

    Joined:
    Nov 6, 2005
    Messages:
    1,259
    Likes Received:
    4
    11K时不学带我入门的:)
     
  10. f

    f New Member

    Joined:
    Apr 8, 2006
    Messages:
    641
    Likes Received:
    0
    真的假的?

    :question:
     
  11. 泪随风逝

    泪随风逝 New Member

    Joined:
    Sep 17, 2005
    Messages:
    2,891
    Likes Received:
    17
    前浪死在沙滩上
     
  12. 西子宜

    西子宜 Well-Known Member

    Joined:
    Sep 5, 2005
    Messages:
    15,739
    Likes Received:
    62
  13. 风允帆

    风允帆 New Member

    Joined:
    Jun 20, 2006
    Messages:
    760
    Likes Received:
    0
    错。明明是前浪死在肚皮上