htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Select site version dir, but make URL look like top-level?
PostPosted: 26 Jun 2008 02:47 
Offline

Joined: 26 Jun 2008 02:05
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Adsense [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB