I want mod_rewrite to do this:
http://server/*
-> redirect tohttp://server/app/*
http://server/app/*
should not be redirected.http://server.domain/*
-> redirect tohttp://server/app/*
http://server.domain/app*
-> redirect tohttp://server/app/*
It has to work with mod_jk!
Edit: this is the final solution
# force use of host 'server'
RewriteCond %{HTTP_HOST} !^server$
RewriteRule ^(.*)$ server$1 [R,NE,L]
# prepend /app to URL if missing
RewriteCond %{request_uri} !^/app.*?
RewriteRule ^(.+?)$ app/$1 [R,NE,L]
Thanks to you, fahadsadah and Insanity5902! I'm hesitant to flag either one of you as 'correct', as both have provided valuable input that made up the final solution.