【问题标题】:Simple apache root redirect简单的 apache 根重定向
【发布时间】:2016-06-14 12:02:33
【问题描述】:

如何进行如下重定向?

  • 通过www.domain.comwww.domain.com/ 加入的用户应发送至www.domain.com/portal

  • 如果他们带有任何附加到域的 URI(即www.domain.com/something),我会将他们发送到那里而不是/portal

【问题讨论】:

    标签: apache url-rewriting


    【解决方案1】:

    Apache 的哪个版本?

    对于 2.0 版

    RewriteEngine on
    RewriteRule   ^/$  /portal/  [R]
    

    我从 Moved DocumentRoot 部分下的 http://httpd.apache.org/docs/2.0/misc/rewriteguide.html 中获取了规则。

    【讨论】:

    • 对不起。它是 2.2 版。你的建议有效!实际上,我确实阅读了几次手册,但我想我跳过了那部分,不理解某些术语。
    猜你喜欢
    • 2011-05-21
    • 1970-01-01
    • 2015-10-21
    • 2013-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多