View Single Post
ישן 29-09-10, 19:44   # 1
Kernel
אושיית הוסטינג
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: בקעת אונו
הודעות: 2,429

Kernel לא מחובר  

כתבתי פעם קוד ל-404,
הוא מכסה את כל הסיומות(php,gif,asp,png וכו').

לשימושכם.

PHP קוד:
<?php
if (strpos($_SERVER['REQUEST_URI'], 'gif') !== false) {
header('Content-type: image/png');
include(
"404.png");
} elseif (
strpos($_SERVER['REQUEST_URI'], 'asp') !== false) {
echo 
"<meta http-equiv=\"refresh\" content=\"0;url=http://www.mysite.co.il/\">";
} elseif (
strpos($_SERVER['REQUEST_URI'], 'gif') !== false) {
header('Content-type: image/png');
include(
"404.png");
} elseif (
strpos($_SERVER['REQUEST_URI'], 'png') !== false) {
header('Content-type: image/png');
include(
"404.png");
} elseif (
strpos($_SERVER['REQUEST_URI'], 'php') !== false) {
include(
"../404.php");
} elseif (
strpos($_SERVER['REQUEST_URI'], 'jpg') !== false) {
header('Content-type: image/png');
include(
"404.png");
} elseif (
strpos($_SERVER['REQUEST_URI'], 'htm') !== false) {
echo 
"<meta http-equiv=\"refresh\" content=\"0;url=http://www.mysite.co.il/\">";
}
else {
echo 
"<meta http-equiv=\"refresh\" content=\"0;url=http://www.mysite.co.il/\">";
}
?>
__________________
אבי
  Reply With Quote