Are you sure you want a redirect? If you redirect from /subdir1
to /subdir1/subdir2
, you are still inside /subdir1
, so quite clearly you'll get another redirect to /subdir1/subdir2/subdir2
, then /subdir1/subdir2/subdir2/subdir2
, and so on until the browser gives up. (As you say in your comment to Sacx's answer.)
If you want to redirect into /subdir1/subdir2
, you'll have to exclude subdir2
from matching the redirect, for example something like:
RedirectMatch permanent /subdir1(?!/subdir2)(.*)$ http://www.example.com/subdir1/subdir2$1
this is pretty ugly though. It's unusual to want to do a redirect from a directory to a subdirectory of itself. Are you sure you really want a redirect? If you just want to make files physically located under /subdir1/subdir2/file
look visible as /subdir1/file
, I think what you'd want would really be an Alias:
Alias /subdir1 /home/wwwuser/examplesite/htdocs/subdir1/subdir2