1

请帮我。我确实尝试在这里阅读旧帖子找到类似的问题,但我没有找到任何东西。我的帖子数据有问题。我正在使用 Apache tomcat + ajp + Apache Httpd 2.2 这是我的httpd.conf的一部分:

#Application has context url = konakart, and tomcat post 8789 for ajp
#I want to avoid typing port in my URL
ProxyPass / ajp://localhost:8789/konakart/

#pretty urls
#I don't want to type http://myshop.com/konakart
#I want http://myshop.com
#I want to put away /konakart/ from URL
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^/konakart/(.*) /$1 [R=301,L] 
RewriteRule send-mail index.php?send-mail [NC,P]

Everyting 没问题...除了 POST 数据丢失。似乎是因为 R=301。但我不能收起 R=301。如果我这样做,没有任何效果。我正在使用 VDS,所以我可以做任何事情......请帮助我克服这个问题 .:(

4

1 回答 1

0

这是 mod_rewrite 和 GWT 以及我的 curl 手的综合问题;)这是有效的 httpd.conf 代码,请参阅代码中的注释:

    #Tomcat through Apache httpd
    ProxyPass /konakart ajp://localhost:8789/konakart
    ProxyPass / ajp://localhost:8789/konakart/

    #pretty urls

    RewriteEngine on
    Options +FollowSymlinks
#do not do anything for POST actions and GWT stuff. It's better not to touch it at all.
#mod_rewrite breaks interconnection of GWT RPC calls.
    RewriteCond  %{REQUEST_URI} !/(.*)EditCartSubmit\.do(.*)
    RewriteCond  %{REQUEST_URI} !/(.*)Submit\.do(.*)
    RewriteCond  %{REQUEST_URI} !/(.*)\.cache\.html
    RewriteCond  %{REQUEST_URI} !/(.*)\.nocache\.(.*)\.js
#Previously GWT servlet had mapping "/konakart"
#I've renamed it to "/KonakartGWTServlet"
    RewriteCond  %{REQUEST_URI} !/KonakartGWTServlet
    RewriteRule ^/konakart/(.*) /$1 [R=301,L] 
于 2012-09-04T12:20:32.680 回答