On Thu, 01 Nov 2007 08:39:14 -0400
Claude Boucher wrote:
<?php
$callingURL = strtolower($_SERVER['REQUEST_URI']); //the requesting
url if ( strpos( $callingURL, 'wikiA') ) {
require_once('wikiALocalSettings.php');
}
else if ( strpos( $callingURL, 'wikiB') ) {
require_once('wikiBLocalSettings.php' );
}
?>
If I may ask, if I'm not mistaken, if you just put in the wrong wiki
name (such as "baz.foobar.net") (and have a wildcard CNAME record), it
looks like it will simply fail. Is there something I can do in that
LocalSettings.php file that will catch all the wildcard stuff that
doesn't seem to exist?
-Dennis
<?php
$callingURL = strtolower($_SERVER['REQUEST_URI']); //the requesting url
if ( strpos( $callingURL, 'wikia') ) { //$callingURL was converted to
lowercase, will never find "wikiA"
require_once('wikiALocalSettings.php');
}
else if ( strpos( $callingURL, 'wikia') ) {
require_once('wikiBLocalSettings.php' );
} else {
?>
<html>
<head><title>Wrong wiki!!</title>
</head>
<body>
<p>You asked for a non-existing wiki.</p>
<p>Please choose where you want to go: </p>
<ul><li><a href="http://wikiA/">wiki A</a></li>
<li><a href="http://wikiB/">wiki B</a></li>
</ul>
</body>
</html>
<?php
exit(0);
}
?>