Forum Moderators: phranque

Message Too Old, No Replies

Redirect folder and everything in it

Tried, but when going to subfolder it doesnt work

         

madmatt69

8:12 pm on Feb 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all,

I've tried using the following rule to 301 an old folder to the root.

redirect 301 /folder/subfolder/ [site.com...]

Now the folder "subfolder" has it's own subfolders. I want all of them to be redirected as well back to the root of the site.

Do I have to specify a wildcard or something? I've tried a few variations that haven't worked.

Help is always appreciated :)

jdMorgan

11:18 pm on Feb 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This matches /folder/subfolder/<as many subdirectory levels ending in "/" as you like, including zero><any filename, including blank> and redirects it to www.example.com/<any filename, including blank>

RedirectMatch 301 ^/folder/subfolder/([^/]+/)*(.*)$ http://www.example.com/$2

Jim

madmatt69

11:48 pm on Feb 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once again I'm in your debt - Works perfectly!