Apache Web服务器mod_rewrite模块RewriteRule问题
我在 Tomcat 6 上有一个 Struts 2 应用程序。Tomcat 前面有一个 Apache 2.2 Web 服务器。 我正在尝试通过 mod_rewrite 创建 Google 友好的 URL。
我正在尝试做的事情: 当我请求http://domainname/some-title
时, 它必须到达 Tomcat 作为 http://domainname:8080/fetch.action?entry.title=some-title
我写了一条规则:
RewriteRule ^/(.*) /fetch.action?entry.title=$1 [L]
但它不起作用! 有人帮助我吗?谢谢。
我的 Apache 虚拟主机配置是:
<VirtualHost *:80>
ServerName ihlsozluk
RewriteEngine on
RewriteRule ^/(.*) /fetch.action?entry.title=$1 [L]
JkMount /* worker1
ErrorLog logs/ihlsozluk-error.log
CustomLog logs/ihlsozluk-access.log common
</VirtualHost>
I have a Struts 2 application on Tomcat 6. There is a Apache 2.2 web server in front of Tomcat.
I am trying to create Google friendly URLs by mod_rewrite.
What I am trying to do:
When I request http://domainname/some-title
,
it must reach to Tomcat as http://domainname:8080/fetch.action?entry.title=some-title
I wrote a rule:
RewriteRule ^/(.*) /fetch.action?entry.title=$1 [L]
But it doesnt work!
Does anyone help me? Thanks.
My Apache virtual host configuration is:
<VirtualHost *:80>
ServerName ihlsozluk
RewriteEngine on
RewriteRule ^/(.*) /fetch.action?entry.title=$1 [L]
JkMount /* worker1
ErrorLog logs/ihlsozluk-error.log
CustomLog logs/ihlsozluk-access.log common
</VirtualHost>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要发出内部代理请求,因为目标端口 8080 可能只能在内部访问:
You need to make an internal proxy request as the destination port 8080 is probably only internally reachable: