I've wrote function in php
function siteContent() {
$path = array();
$strDefaultPath = '/sites/';
$_SERVER['PATH_INFO'] = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : $strDefaultPath;
$path = explode( '/', substr( $_SERVER['PATH_INFO'], 1) );
if(file_exists('/'.$path['0'].'.php')) {
require_once('/'.$path['0'].'.php');
} else {
require_once('sites/main.php');
}
}
it doesn't work
in menu links looks like this http://site.com/subsite/ but path to the files with content of subsites looks likt this public_html/sites/subsite.php
can i rewrite url with this function or
how can i rewrite or build that urls in php only
i'm beginnier in php