2015-10-14 115 views
1

我的Tomcat Web應用程序有以下路徑:Tomcat urlrewritefilter - 從目錄路徑到根路徑?

http://192.168.0.1/app/ 

如何爲它創建一個別名,像這樣(不想鍵入app)?

http://192.168.0.1/ 

我不能改變server-mappingweb.xml

我試過Tuckey URLRewrite

<rule> 
    <from>/</from> 
    <to type="redirect">/app/</to> 
</rule> 

但是,當嘗試訪問http://192.168.0.1/,它使URL成爲這並不起作用。

http://192.168.0.1/app/app/app/app/app/app/app/app/app/ 

回答

1

試試這個

<rule> <from>^/*</from> <to type="redirect">/app/</to> </rule>