Can I redirect to a directory of files, but make URLs look like top-level?
It's been useful to manage versions of sites in separate directories and then to simply select the live version with a top-level redirect. A simple top-level redirect is super easy and makes changing the live site a one-line change.
However, what I'd REALLY like is to hide the revision directory structure from the viewer so that all URLs appear to originate from the top-level - e.g., a person sees a URL of mydomain.com/index.html rather than the REAL location of mydomain.com/dev/v02/index.html. I want the results of a redirect but with a rewrite of the URLs that the user (or search engines) will see.
Sample directory structure at the top-level:
Code:
http://mydomain.com
/dev/v01
/index.html
/contact.html
...
/dev/v02
/index.html, ...
When a user types my domain name (mydomain.com), I'd like to see the site files from the /dev/v02 directory and appear as though they were in the top-level. Can I hide the "/dev/v02" in all of those URLs?
It seems like this could be done with a .htaccess file using RewriteBase and RewriteRule(s). If so, how would that work? Would you want a .htaccess file in each version directory (e.g., v02/.htaccess)? I'm scratching my head on this and have tried numerous variations of .htaccess files. Perhaps there's some other better way to accomplish the same thing.
Thanks in advance.
Gerry