Update index.php

included device detection n redirection when necessary