0

I'm using the latest version of IIRF to handle URL redirections (301s) for SEO. I'm having problems figuring out the syntax for this rule though.

I'm trying to redirect URLs which match this pattern...

http://www.mysite.com/folder1/*

to

http://www.mysite.com/folder2/*

Where the * is the part of the URL I'm trying to preserve.

The closest I've got is...

RedirectRule ^/folder1/$ /folder2/ [I,R=301]

...however that doesn't append the rest of the URL.

Any help would be appreciated.

1 Answer 1

1

Try this:

RewriteRule ^/folder1/(.*[^/])$ /folder2/$1 [I,R=301]

It should pick up everything after folder1/* till next / and append it after /folder2/

1
  • Actually one of my colleagues just figured it out. But thanks for your contribution, I'll accept your answer. The actual rule I used was: RedirectRule ^/folder1/(.*) /folder2/$1 [I,R=301] Feb 17, 2011 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .