File: //opt/index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
//if ($_SERVER['REQUEST_URI'] == "/") {
// if (!isset($_GET['nocache'])) {
// echo "<!-- cache mode -->";
// if(isMobile()){
// include("cache/homepage_mobile.html");
// die();
// } else {
// include("cache/homepage.html");
// die();
// }
// }
//}
if (!isset($_GET['preview']) && !isset($_GET['s'])) {
if ($_SERVER['REQUEST_URI'] == "/") {
if(isMobile()){
header("Location: /index.php/homepage-mobile/");
die();
}
}
}
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );