23-04-2011, 16:14
|
|
|
חבר מתאריך: 19.11.10
הודעות: 48
|
|
אם השרת apache מכיל מודול mod_proxy, הקוד הבא יעבוד
קוד PHP:
RewriteEngine On RewriteRule ^1$ http://phpguide.co.il/static/images/logo\.jpg [P,L]
אם לא, תצטרך לבנות סקריפט שישמש כפרוקסי
קוד PHP:
RewriteEngine On RewriteRule ^(\d+)$ getimage.php?id=$1 [L]
-- <?php if( isset($_GET['id'])) { switch($_GET['id']) { case 1: header('Content-Type: image/jpeg'); readfile('http://phpguide.co.il/static/images/logo.jpg'); break; case 2: header('Content-Type: image/png'); readfile('http://phpguide.co.il/static/images/feed.png'); break; } }
|