Forum Moderators: phranque

Message Too Old, No Replies

rewrite 301 from root to [images] directory

301 redirect apache

         

mslina2002

7:42 pm on Sep 25, 2007 (gmt 0)

10+ Year Member



I checked all previous posts, but couldn't find anything. Also, search jdmorgan's posts.

I recently moved all image files from my root to [images] directory. Now I would like to redirect the sites linking to my images to the new directory.

I tried different versions of 301 but they don't seem to work in my .htaccess file. This is what I am using to try the 301.

Redirect 301 (.*)\.gif$ http://www.example.com/images/$1.jpg

thank you!

coopster

8:59 pm on Sep 25, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You are using a regular expression there, you may want to try RedirectMatch [httpd.apache.org] instead.

g1smd

5:16 am on Sep 26, 2007 (gmt 0)

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



Terminology. Using 301 is a redirect, not a rewrite. That's an important difference.