29-09-10, 22:47
|
# 4
|
מקום שלישי בתחרות קידום אתרים
|
ציטוט:
נכתב במקור על ידי 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/\">";
}
?>
|
מה אני עושה איתו? מכניס אותו לאיזה קובץ?
|
|
|