0

Hi everyone,

I have a problem which needs an urgent solution!

I recently uploaded hundreds of images to the pictures section of my website with file names like this:

rihanna-battleship-movie-premiere.jpg

It was only after I uploaded hundreds of images adding the file extension ".jpg" that I realised that I should not have added this file extension to each file name as now these images are appearing on the website as rihanna-battleship-movie-premiere.jpg.jpg and are therefore not appearing on successfully on google.

Is there a way that I can remedy this problem quickly without having to replace each separate image with a replica image with the correct file name?

Many thanks.

3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by hericles
0

In Windows explorer, configure the view to show extensions. Verify whether the .jpg is part of the file names. For example image.jpg.jpg. If so, you really should correct this.

If not you may be inserting .jpg additionally in your website coding.

0

If you have added them with the doubled extension and there really are hundreds of them, write a script to get all images in the folder and rename each one in turn (taking the file name part, ignoring the extension, and checking if it contains .jpg. If it does do a string.replace to remove it.
Be a lot faster than renaming them all by hand.

0

Thanks Hericles,

How would this all work? Would the same image files still show successfully on the website but would just have different file names minus the .jpg file extension once your solution is implemented?

And how easy is this to carry out? As I am a beginner

0

I'm not sure how the website is loading the images but as it shows the image with the incorrect name now (rather than not showing anything because the URL is incorrect) I'm guessing that as soon as everything is renamed the images will display correctly sans the repeated .jpg.
Have a look at this post: http://bytes.com/topic/c-sharp/answers/440212-renaming-files-directory
You want to do almost the same thing but instead of moving files like he is, you need to get the file part of the name of each file in the FileInfo array and check if it contains .jpg. If yes, strip it out.

0

Hi there thanks for this.

The web marketing company I am using say they can add some information to the robot.txt file which will instruct google to view images with this file extension .jpg.jpg as a simple jpg file.

Would this work?

0

Can't help you there I'm afraid, my knowledge of the robots.txt file only handles how to hide files and folders. I would have to assume they know what they are doing though.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.