0

Let me know if i can make url of image like this http://placehold.it/1000/1000 other then this https://i.ytimg.com/vi/sXAwqoJ-WUA/maxresdefault.jpg

In short, i want to change image link (https://i.ytimg.com/vi/sXAwqoJ-WUA/maxresdefault.jpg) to my site directory (mysite.com/images/one)

Edit: This is not duplicate of other question because i want to do this when the image is not on my server.

shpwebhost
  • 66
  • 11
  • store the file on your server and use apache's `mod_rewrite` – BlobbyBob Dec 02 '17 at 09:53
  • Possible duplicate of [Can I use images without extension in ?](https://stackoverflow.com/questions/5110384/can-i-use-images-without-extension-in-img) – Amaury Hanser Dec 02 '17 at 09:56
  • but this can be possible when image on my server. I want to do this with youtube thumb url for - https://fbthumbtube.com where people can use large thumb but image not in my server. – shpwebhost Dec 02 '17 at 09:59

2 Answers2

0

Yes you can do this for that you have to create an html file and in 'index.html' you can insert images into the image tag.

 <!DOCTYPE html>

<html>

<head>

<title> images </title>

</head>

<body>

<img src="http://placehold.it/1000/1000 " style="max-width: 100%">

</body>

</html>

file loction mysite.com/images/one/index.html
and run your link mysite.com/images/one

RamNiwas Sharma
  • 337
  • 2
  • 6
0

First things first: you need to own the placehold.it domain.

Then...

  1. Redirect http://placehold.it/1000/1000 to be handled by a php script. For example in your placehold.it server add the following rule to the .htaccess file:

    Redirect /1000/1000 /myscript.php

  2. Let myscript.php to get the image from the remote-server and serve it (check this thread: how to get image from curl)

    • (optional) in order to minimize curl requests to the remote server (and optimize performance) you can save the image (once) and then serve the saved copy (whenever requested)
  3. Write the html ...

    <img src="http://placehold.it/1000/1000">

Geo Halkiadakis
  • 370
  • 1
  • 7