View Single Post
ישן 29-09-10, 22:47   # 4
kondason
מקום שלישי בתחרות קידום אתרים
 
מיני פרופיל
תאריך הצטרפות: Jun 2010
הודעות: 1,303

kondason לא מחובר  

ציטוט:
נכתב במקור על ידי 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