1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HNeed a script to duplicate an Image 5000 times in my hosting

Discussion in 'General Scripting Chat' started by diso333, Jul 28, 2016.

  1. diso333

    diso333 Junior Member

    Joined:
    Aug 6, 2013
    Messages:
    153
    Likes Received:
    50
    Gender:
    Male
    Occupation:
    Busy Making a Million Dollars
    Location:
    Morocco
    Hello,

    I need a script that can duplicate my image 5000 times in my hosting and give me different 5000 urls.

    So each duplicated image has it's own link.

    Also if there's a wordpress plugin to do this or a script that I can use in my host it's the same for me.

    Please if you know how to do this. or where I can find one.

    thanks
     
  2. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    335
    Likes Received:
    242
    Maybe you can create a .htaccess file which redirects all .jpg/.gif/.png/.bmp requests to one image, so you don't have to duplicate the image 5000 times. Piece of cake.
     
    • Thanks Thanks x 1
  3. diso333

    diso333 Junior Member

    Joined:
    Aug 6, 2013
    Messages:
    153
    Likes Received:
    50
    Gender:
    Male
    Occupation:
    Busy Making a Million Dollars
    Location:
    Morocco
    Thanks for the tip. would it be possible to make all .jpg/.gif...etc have the same image other than redirects them to the original image ?
     
  4. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    335
    Likes Received:
    242
    With .htaccess you can direct the requests to whatever image you want. Why would you create 5000 similar images if you can redirect the requests to one single image?
     
    • Thanks Thanks x 1
  5. diso333

    diso333 Junior Member

    Joined:
    Aug 6, 2013
    Messages:
    153
    Likes Received:
    50
    Gender:
    Male
    Occupation:
    Busy Making a Million Dollars
    Location:
    Morocco
    If facebook crawler wouldn't detect the same url. and think it's different url each time. I wouldn't mind.
     
  6. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    335
    Likes Received:
    242
    Well, here you go.
    Put this code in a .htaccess file, every image request leads to testimage.jpg, the browser doesn't know it's leading to testimage, because it's rewritten on the server. The browser only knows for example http://blablabla.com/image8574648568.jpg. That's what the browser sees.
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI}  (\.png|\.jpg|\.gif|\.jpeg|\.bmp)$
    RewriteRule (.*)  testimage.jpg [QSA]
    
     
    • Thanks Thanks x 1
  7. diso333

    diso333 Junior Member

    Joined:
    Aug 6, 2013
    Messages:
    153
    Likes Received:
    50
    Gender:
    Male
    Occupation:
    Busy Making a Million Dollars
    Location:
    Morocco
    Well, I can't thank you enough.

    I really appreciate it man.

    Thanks
     
  8. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    335
    Likes Received:
    242
    You're welcome.
     
    • Thanks Thanks x 1