I have a domain foo.com running on apache 2.2 with SSL. Any time someone types the following in the browser:
- foo.com
- http://foo.com
- www.foo.com
- https://foo.com
I want it all to get redirected to: https://www.foo.com/bar/index.xhtml
I've tried the suggestions from the Apache site:
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) http://www.example.com:%{SERVER_PORT}/$1 [L,R]
but they are not working. I would be happy just to get the rewrite rule for the scenarios I listed; not everything.