URL 重定向 - 附加到链接末尾
我正在使用 Glassfish V3
我目前有用户使用 http://mydomain.com/workbench 访问我的应用程序
我想要这样,如果用户没有放置工作台部分,他们就会被定向到它
。
'http://mydomain.com' --> 'http://mydomain.com/workbench'
'http://mydomain.com/workbench' (这不应该重定向
'http://mydomain.com/PDA' (这不应该重定向)
我尝试过使用redirct_n 但它没有解决问题;正如我这样做的:
redirect_1 from=/my-app url=http://mydomain.com/workbench
出于明显的原因,这会创建一个无限循环
I am using Glassfish V3
I currently have users that access my application using http://mydomain.com/workbench
I want it so that if the user doesn't put the workbench part that they are directed to it
E.g.
'http://mydomain.com' --> 'http://mydomain.com/workbench'
'http://mydomain.com/workbench' (this shouldn't redirect
'http://mydomain.com/PDA' (this shouldn't redirect)
I have tried using redirct_n but it hasn't solved the problem; as I did this:
redirect_1 from=/my-app url=http://mydomain.com/workbench
for obvious reasons this creates an infinite loop
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这种方法可能不适合你。它适用于状态和错误页面(例如 40x)。如果您需要更复杂的规则,我建议您研究以下解决方案:
+ 从您的应用程序进行 URL 重写 借助周围应用程序的一点帮助(例如,http://ocpsoft.com/rewrite/< /a>)
+ Apache mod_proxy 和 mod_rewrite
Rgds,
马库斯
this approach probably isn't working for you. It's meant for status and error pages (e.g. 40x). If you need more complex rules I suggest looking into any of these solutions:
+ URL Rewriting from your app With a little help from the apps around (e.g., http://ocpsoft.com/rewrite/)
+ Apache mod_proxy and mod_rewrite
Rgds,
Markus