<?php

$pos = strpos($_SERVER["SCRIPT_NAME"],'teacher');
$folder = substr($_SERVER["SCRIPT_NAME"],0,$pos);

$page = 'Files/Enotita5/teacher/';

$url = 'http://'.$_SERVER["HTTP_HOST"].$folder.$page;

Header("Location: $url");

?>