Alfin Paul
Alfin Paul

Reputation: 1631

.htaccess 301 redirect for images from old image to new image

I am currently using images on my site with non descriptive file names such as kejr09238u30sdkfh.jpg. I will be renaming these images to something like descriptive-file-name.jpg for SEO reasons. currently 6 images renamed.

how to write 301 redirection?

example

mysite.com/images/123.jpg Renamed to mysite.com/images/abc.jpg

Can you guys help me please?

Upvotes: 2

Views: 3286

Answers (1)

Michal
Michal

Reputation: 3632

Use simple redirect command:

# Redirect old file path to new file path
Redirect 301 /images/123.jpg http://example.com/images/abc.jpg

Upvotes: 2

Related Questions