我正在使用Redhat,並且正在嘗試在apache tomcat中重定向url。例如,我有一個網址是http:// example:8282。我想重定向頁面,這樣當我輸入http:// example/alfresco時,它會在瀏覽器中顯示http:// example/alfresco,以便用戶看不到端口號。我已經成功地重定向,但沒有重定向,並保持我想重定向到實際url的url,我不想看到。如何在Apache Tomcat 8.0.9中使用端口號重定向URL,以便用戶無法看到端口號
事情我在/etc/httpd/conf/httpd.conf中已經嘗試
#
Redirect permanent /alfresco http://<ip address>:8282/
#
我也試過
#
RedirectMatch ^/tomcat/(*)$ http://<ip address>:8282/$1
#
我也試過
#
RewriteEngine On
RewriteCond %<ip address>:8282 !^1.1.33.201\/tomcat
RewriteCond %<ip address>:8282 !^$
RewriteCond %8080 !80$
RewriteRule ^tomcat/?$ http://<ip-address> [PT]
#
謝謝你, 任何幫助,將不勝感激
我appcreciate您的答覆。這可以工作,但不能用於目錄結構。我可以去http:///tomcat,但是如果我點擊tomcat裏的一個叫做docs的鏈接,它會嘗試去http:// /docs,它有一個錯誤說網頁不存在,因爲它確實存在沒有考慮到代理。它應該去http:// /tomcat/docs。所以它確實有效,只是沒有目錄結構。 –
jbaile33
2014-09-23 22:03:16
可以請你說明你如何配置ProxyPass? – 2014-09-24 14:26:07