I have a Ruby on Rails app with two sub-sites, www.example.com/site1
and www.example.com/site2
. For demonstration purpose, we need to disable site2
and only show site1
. So I made some redirects in my apache virtual host conf like this
Redirect 301 http://www.example.com/site2 http://www.example.com/site1
Redirect 301 http://www.example.com http://www.example.com/site1
to be sure to always redirect to site1
. Now, it would be great, if we could kinda strip out the site1
from the url http://www.example.com/site1
so that it only shows http://www.example.com
, but also can handle sub sites (e.g. the "original" site is http://www.example.com/site1/cat1
and it should be displayed as http://www.example.com/cat1
).
- Is this possible using apache's rewrite engine? And how?
- I'm not sure if I have to change something inside my app, or is the request URL (that my router picks up) not modified by apache?
- Another solution would be, to only show the domain in the users address bar. Is this possible, and how?