Does you index file have an extension of .php or .html?
Any PHP code will output as plain text unless the file extension is ".php" (assuming the server has PHP installed to parse .php files).
Assuming the extension was ".php", and you have PHP installed, try adding the following code:
Code:
error_reporting(E_ALL);
ini_set("display_errors", "on");
after:
Code:
<?php
@include("Mobile_Detect.php");
In your current code.
This will ensure it outputs any PHP errors, so you can report back if that happens.
The only reasons I can see this not having redirected is either
1) PHP isn't installed, so even with a .php extension it will just display it as text
2) Somewhere in the file you include, it outputs some text, which will cause header() to fail since it has to be called before any output it sent..
Let me know and I'll see if I can help some more.