Help with mod-rewrite to display a new url
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]
精彩评论