【问题标题】:How to hide a rewrited URL in web browser如何在 Web 浏览器中隐藏重写 URL
【发布时间】:2014-03-20 01:52:44
【问题描述】:

我使用 Apache 的 mod_rewrite 将 HTTP 请求重定向到另一台服务器。我想在客户端的浏览器中保留原始 URL。现在它在客户端的浏览器中显示重写的 URL。 Httpd.conf 文件中的配置如下。提前谢谢。

重写引擎开启 RewriteBase /tpiaccs/ RewriteRule /tpiaccs/uat/(.*) http:///tpiaccs/uat/$1 [NC,L]

【问题讨论】:

    标签: apache url mod-rewrite hide


    【解决方案1】:

    如果我没记错的话,默认情况下它会使用外部重定向(隐式 [R] 标志)重写,除非您另有说明。

    这可能会满足您的需求:

    RewriteRule /tpiaccs/uat/(.*) http:///tpiaccs/uat/$1 [P,NC,L] 
    

    P 应该让它在内部代理请求而不是进行外部重定向。

    有关可用于 URL 重写的标志的详细信息,请参阅 https://httpd.apache.org/docs/trunk/rewrite/flags.html

    【讨论】:

      猜你喜欢
      • 2012-06-16
      • 1970-01-01
      • 1970-01-01
      • 2019-09-16
      • 1970-01-01
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多