With Apache, how to make a URL (lets say an Image Path) to be actually coming from another location. For example, i have a html page with an URL like:
apple.html, with the original codes inside:
<img src="http://www.myoldsite.com/assets/image/apple.jpg" />
<img src="http://www.myoldsite.com/assets/image/orange.jpg" />
But actually i want this path to be re-written to:
<img src="http://www.mynewsite.com/image/apple.jpg" />
<img src="http://www.mynewsite.com/image/orange.jpg" />
So when i access the apple.html page, the image should be coming from new location, without needed to go and change the actual codes inside the files each.
But actually i'm totally weak in .htaccess rules. When i used like following, it is showing error:
RewriteEngine On
RewriteRule http://www.mynewsite.com/image/(.*) /assets/image/$1 [QSA, L]
I am having thousands of pages like this but I am totally stuck with .htaccess rules.
What am i missing please? Please help.