Page 1 of 1
cloaking
Posted: Fri Jan 03, 2003 9:05 pm
by gilliepit
I've been looking for a while now for some sort of cloaking script so that I can finish hacking up my 404
I am redirecting with JavaScript out of my 404, I pass in the URI through the query string.. but I want to eliminate the new file name and whathaveyou.. any suggestions?
Looks a little something like this after redirected from the 404...
http://www.site.com/error_handler.php?r ... erequested
and I want it to look like..
http://www.site.com/foldernamerequested
What am I trying to do, you ask? -- make it look like a bagillion folders exist that really don't.
Am I going about this the wrong way?
Posted: Fri Jan 03, 2003 10:05 pm
by mydimension
this is possible but not using client side tools. you can use the Apache module ModRewrite provided your host has it and allows you to use it. aside from that im not sure how else you might accomplish it.
Cloaking Database
Posted: Wed Jan 15, 2003 6:18 am
by crazyjimsmith
<?
/*This is a link cloaker that require a database. Database name must be given and the table name needs to be redirects
*/
$db_name = "linkcloak";
$table_name = "redirects";
$pathstring = getenv("HTTP_HOST") == "localhost" ? getenv("PATH_INFO") : $PHP_SELF ;
$id = $id;
$connection = mysql_connect("localhost", "linkcloak","")
or die("Couldn`t connect.");
$db = mysql_select_db($db_name, $connection) or die("Couldn`t select database.");
$sql = "SELECT id, address FROM $table_name";
$sql .= " WHERE id = " . $id . ";";
$result = mysql_query($sql,$connection) or die("Couldn`t execute query.");
while ($row = @mysql_fetch_array($result))
{
$id = $row["id"];
$address = $row["address"];
}
print "<HTML><HEAD>\n";
print "<SCRIPT language=\"JavaScript1.1
\">\n";
print "<!--\n";
print "location.replace(\"".$address."\");\n";
print "//-->\n";
print "</SCRIPT>\n";
print "<NOSCRIPT>\n";
print "<META http-equiv=\"Refresh\"content=\"0;URL=".$address."\">\n";
print "</NOSCRIPT>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "Click <A href=\"".$address."\">here</A> to continue.\n";
print "</BODY>\n";
print "</HTML>\n";
?>
I found it somewhere. Don't ask me how it works. You have to make your database and insert the links you want cloacked. I think they are referenced by the id.
Posted: Wed Jan 15, 2003 10:40 am
by mydimension
probably should have updated this but we resolved this privately.