开发者

Help with mod-rewrite to display a new url

开发者 https://www.devze.com 2023-01-18 18:40 出处:网络
hi all i have my app configured with mod ajp to be as follows: http://www.myapp.com/myapp so when i request a pag开发者_JAVA技巧e like mypage, the url will be

hi all i have my app configured with mod ajp to be as follows:

http://www.myapp.com/myapp

so when i request a pag开发者_JAVA技巧e like mypage, the url will be

http://www.myapp.com/myapp/mypage

and i want when the user requests the page

the url is displayed as:

http://www.myapp.com/mypage

instead of

http://www.myapp.com/myapp/mypage

any ideas how to do so ?


problem solved after installing a fresh copy of tomcat


Try this rule:

RewriteRule !^/myapp/ /myapp%{REQUEST_URI} [L]

And to redirect requests of the “wrong” path:

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /myapp/
RewriteRule ^/myapp/(.*) /$1 [L,R=301]
0

精彩评论

暂无评论...
验证码 换一张
取 消