Forum Moderators: phranque

Message Too Old, No Replies

Redirecting Directories

         

keyplyr

5:52 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using Apache Server

I've had to change the name of an image directory. I've made the changes to the webpages, but wish to redirect any existing remote links:

RedirectMatch 301 ^/old/ [domain.com...]

What do I need to add to this to include the files? Thanks.

jdMorgan

6:30 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



keyplyr,

You can just use Redirect if you want to redirect all files in the folder /old to the same-named files in folder /new


Redirect 301 /old/ http://www.domain.com/new/

Otherwise, you'll need to create a back-reference in RedirectMatch and use it:

RedirectMatch 301 ^/old/(.*)$ http://www.domain.com/new/$1

but this is the default behaviour of Redirect.

Jim

keyplyr

6:34 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Jim, that does it.