2 // Handle inexistant favicon requests
\r
3 if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) {
\r
4 header('Content-Type: image/gif');
\r
5 echo base64_decode("R0lGODlhEAAQAJECAAAAzFZWzP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0PUQAgSGoNQFt0LWTVOE6GuX1H6onTVHaW2tEHnJ1YxPc+UwAAOw==");
\r
12 require_once( dirname(__FILE__).'/includes/load-yourls.php' );
\r
14 // Load required template
\r
16 // Get request in YOURLS base
\r
17 $scheme = ( isset($_SERVER["HTTPS"]) ? 'https' : 'http' );
\r
18 $request = str_replace( YOURLS_SITE.'/', '', $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
\r
20 // Make valid regexp pattern from authorized charset in keywords
\r
21 $pattern = yourls_make_regexp_pattern( yourls_get_shorturl_charset() );
\r
23 // Test server request and redirect accordingly
\r
24 if( preg_match( "/^([$pattern]+)\/?$/", $request, $matches ) ) {
\r
25 // yourls-go.php?id=$1
\r
28 if( preg_match( "/^([$pattern]+)\+\/?$/", $request, $matches ) ) {
\r
29 // yourls-infos.php?id=$1
\r
32 if( preg_match( "/^([$pattern]+)\+all\/?$/", $request, $matches ) ) {
\r
33 // yourls-infos.php?id=$1&all=1
\r