Objective
To use .htaccess rules to redirect /site/ to /site/YYYY/ on pages that rely on FrontPage Server Extensions.
The Redirect
I use RedirectMatch in /site/.htaccess for redirects to sub-directories:
RedirectMatch ^(/site/?|/site/index\.html)$ /site/YYYY
This rule says that the server should redirect requests for either this directory (/site/) or this directory’s index file (/site/index.html) to /site/YYYY/.
Caution
Add the additional rules after the part of the .htaccess file that FrontPage has already written to.
The Workaround
This will work for basic pages, but for pages that rely on FrontPage Server Extensions there is an extra step. You need to add:
Options +FollowSymlinks
to each of the .htaccess files in the underscore sub-directories of /site/, and their sub-directories too, e.g.:
_private/.htaccess_vti_bin/.htaccess_vti_bin/_vti_adm/.htaccess_vti_bin/_vti_aut/.htaccess_vti_cnf/.htaccess_vti_pvt/.htaccess_vti_txt/.htaccess
As above, be sure to add the new rule at the end of the file, after the FrontPage-related rules. If you add the redirect rule to the main .htaccess file but don’t add the options rule to these other .htaccess files then people will not be able to log into /site/ (i.e. open the /site/ “web”) using FrontPage.
Relevant sites
Sites that I’ve set up to work this way are:
- http://www.wesleyan.edu/hcfw/
- http://www.wesleyan.edu/honors/
- http://www.wesleyan.edu/mlc/
- http://www.wesleyan.edu/rc/
See also:
- FrontPage and mod_rewrite workaround for time-based rewrites on this site
- FrontPage and the .htaccess file
.htaccess Resources:
- Advanced htaccess demo/example using cookies, headers, rewrites (Ask Apache)
- Stupid htaccess tricks (Perishable Press)
- Ultimate htaccess examples (Evolt)