Forum Moderators: phranque
I do not understand regular expressions very well and am trying to find a rewrite rule that will allow me to redirect calls to old directories to new ones.
For example, Google currently has this page indexed:
domain.com/subdirectory-one/page
But "subdirectory-one" is now called "subdirectory-two," so I would like to redirect the above link to:
domain.com/subdirectory-two/page
I've gotten somewhat close with this, but the following appends the old subdirectory:
RewriteRule ^subdirectory-one.*$ [domain.com...] [R=301,L]
Result: domain.com/subdirectory-two/subdirectory-one/page
Any help is much appreciated!
Alex
<snip>
[edited by: jdMorgan at 1:32 pm (utc) on May 16, 2006]
[edit reason] No URLs, please. See TOS. [/edit]
RewriteRule ^subdirectory-one/(.*)$ http://www.example.com/subdirectory-two/$1 [R=301,L]
Jim