远程照片同步
当然可以用nginx了,不过我这里没有用nginx就简单写了一个php抓取远程图片然后本地保存来实现的。
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) get.php?image=$1 [L]
get.php
<?php
$image = $_GET['image'];
$url = 'http://aaa.com/image/';
file_put_contents($image, file_get_contents("$url$image"));
header("Location: $image");