Update
Thanks for all the replies so far. I'd like to make clear that the number after user
(e.g. user1) in my example is not significant. The user can be any alphanumeric name.
I want to make sure that if a directory is specified, we append "/faces/main.jsf" to the end of it.
For example
We want to URL to look like:
example.com/user1/faces/main.jsf
The system could append things like (which we must allow)
http://example.com/user1/faces/main.jsf;jsessionid=Z_DV-bY6MuQGlIvflPwgdKDk60cNzOkWXbC5G18ILrjR0jKoGWnd!-617980607
If a request looks like either of these:
example.com/user1
example.com/user1/
I'd like "/faces/main.jsf" to be appended to it. What's wrong with my rewrite rules?
<VirtualHost *:80>
ServerName example.com
ProxyPass / http://1.example.com:8888/
ProxyPassReverse / http://1.example.com:8888/
RewriteEngine On
# RewriteLog /tmp/rewrite.log
RewriteCond %{HTTP_HOST} !^example.com$
RewriteRule !^/(.) http://example.com/$1 [L,R]
RewriteCond %{REQUEST_URI} !^/(.+/)faces/main.jsf.*
RewriteRule !^(.+)/faces/main.jsf.*$ $1/faces/main.jsf [L,R]
</VirtualHost>
user1
) is not significant. It can be any user name.user
is arbitrary alphanumeric string.