【问题标题】:apache ignore htaccess and reach tomcatapache忽略htaccess并到达tomcat
【发布时间】:2014-12-22 23:49:44
【问题描述】:

我有一个在 tomcat 上运行的 java 应用程序,我正在使用 apache mod_proxy 模块将文件传递给 tomcat,但是 tomcat 似乎忽略了 .htaccess 文件,这里是我的 vhost.conf。如何指示 apache 读取 .htaccess

< Proxy *>

        Order deny,allow
        Allow from all

< /Proxy>

    ProxyRequests           Off
    ProxyPreserveHost   On
    ProxyPass               /   http://localhost:8080/
    ProxyPassReverse        /   http://localhost:8080/

我的 htaccess 有一个规则为

RewriteRule ^/login(.*)$ /system/customer/portal/1$1 [R]

我的 apache 忽略它并立即访问 tomcat ..

我正在尝试使用

ProxyPass /login !

但没有成功,有什么提示吗?

【问题讨论】:

    标签: apache .htaccess mod-rewrite mod-proxy


    【解决方案1】:

    您可以使用ProxyPassMatch 和regex 来排除这些位置:

    ProxyPassMatch ^/(login|system/customer/portal/) !
    

    【讨论】:

      猜你喜欢
      • 2011-07-09
      • 2019-04-15
      • 1970-01-01
      • 2013-03-21
      • 1970-01-01
      • 1970-01-01
      • 2015-12-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多