This rule is too greedy, "my-dir" should only redirect when it is the root directory e.g. /my-dir

RewriteRule ^my-dir/(.*)$ new-dir/my-dir$1 [R=301,L]

But this rule does not work at all!

RewriteRule ^/my-dir/(.*)$ new-dir/my-dir$1 [R=301,L]
link|improve this question

Enable logging (via RewriteLog and RewriteLogLevel). This should help you solve the problem. – larsks Jan 10 '11 at 21:36
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.