<?php
function to($url='') {
//	if(empty($url) || $url=='/') $url = '/backs';
    $uri = file_get_contents('./uri');
    if(empty($uri)) exit;
//    header("Location: https://{$uri}/{$url}");
    echo "<script>location.href='https://{$uri}/{$url}';</script>";
    exit;
}

if(!empty($_SERVER['REQUEST_URI'])) {
//	to($_SERVER['REQUEST_URI']);

    $uri = $_SERVER['REQUEST_URI'];
    if(strstr($uri,'?')) {
        $uri = explode('?', $uri);
        $uri = $uri[0];
    }
    $uri = substr($uri,1,strlen($uri));
//    exit($uri);
    if(strstr(",backs,app,login,",",{$uri},")) to($uri);
}
to();

