I have a series of RewriteRules in .htaccess for my site which I'm in the process of restructuring.
# Requests for http://example.com/contents/section/4/48/
# get redirected to http://example.com/courses
RewriteRule ^content/section/4/48/$ /courses [R=301,L]
This is working fine, except that right now I've got the new and unreleased site sitting in a /new/
subdirectory, and so while testing, I need the rules to redirect to /new/courses
instead of /courses
... basically I just want it to redirect to a URL relative to where the .htaccess file is.
/home/user/www/new/.htaccess --> redirect to /new/courses
/home/user/www/.htaccess --> redirect to /courses
It doesn't seem right that I'd have to change each line in the /new/.htaccess file when I move it to root directory. Is there something I'm missing?