diff options
author | D. V. Serg <dvserg@pfsense.org> | 2007-11-12 11:45:51 +0000 |
---|---|---|
committer | D. V. Serg <dvserg@pfsense.org> | 2007-11-12 11:45:51 +0000 |
commit | 66580fb4071916c389d5316f37cfbee5f5d4144a (patch) | |
tree | 4aa4d9b8e8cde837cb685ab5b5a9cdc1cefeb01f /packages/squidGuard/sgerror.php | |
parent | 8054ea8784cc395644c780a42b90b8f9043e41f0 (diff) | |
download | pfsense-packages-66580fb4071916c389d5316f37cfbee5f5d4144a.tar.gz pfsense-packages-66580fb4071916c389d5316f37cfbee5f5d4144a.tar.bz2 pfsense-packages-66580fb4071916c389d5316f37cfbee5f5d4144a.zip |
*** empty log message ***
Diffstat (limited to 'packages/squidGuard/sgerror.php')
-rw-r--r-- | packages/squidGuard/sgerror.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/packages/squidGuard/sgerror.php b/packages/squidGuard/sgerror.php new file mode 100644 index 00000000..302126fb --- /dev/null +++ b/packages/squidGuard/sgerror.php @@ -0,0 +1,51 @@ +<?php +# ---------------------------------------------------------------------------------------------------------------------- +# Error page generator +# (C)2006-2007 Serg Dvoriancev +# ---------------------------------------------------------------------------------------------------------------------- +# .php?url='redirect url' +# ---------------------------------------------------------------------------------------------------------------------- +# Forbidden 403 +# Not found 404 +# 410 +# Internal Error 500 +# Moved 301 +# Found 302 +# ---------------------------------------------------------------------------------------------------------------------- + +define('ACTION_URL', 'url'); +define('ACTION_RES', 'res'); +define('ACTION_MSG', 'msg'); + +header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + +$url = ''; +$msg = ''; +if (count($_POST)) { + $url = $_POST['url']; + $msg = $_POST['msg']; +} else { + $url = $_GET['url']; + $msg = $_GET['msg']; +} + +if ($url) { + if (strstr($url, "301")) header("HTTP/1.0 301"); + elseif (strstr($url, "302")) header("HTTP/1.0 302"); + elseif (strstr($url, "403")) header("HTTP/1.0 403"); + elseif (strstr($url, "404")) header("HTTP/1.0 404"); + elseif (strstr($url, "410")) header("HTTP/1.0 410"); +# elseif (strstr($url, "410")) header("HTTP/1.0 500"); + else { + # + # redirect to specified url + # + header("HTTP/1.0"); + header("Location: $url", '', 301); + } + exit(); +} else { + header("HTTP/1.0 410"); + exit(); +} +?>
\ No newline at end of file |