I use rsync to sync pictures between 2 servers. The rsync is running every hour.
The original subdomain of the pictures is photo1.mydomain.com. I rsync everything to photo2.mydomain.com.
Everything is OK with older pictures but I want to work with new pictures as well as I want to serve images from photo2.mydomain.com. I created a redirect.php file on photo2.mydomain.com:
<?php
header('HTTP/1.1 302 Found');
header('Location: [
photo1.mydomain.com'.$_SERVER['REQUEST_URI'])...]
?>
The problem is how do I tell apache on photo2.mydomain.com to execute the redirect.php file if the file is not found on the server?
Thanks in advance for your help.