My code works for all my sites except the ones that begin with "es". Whenever I try to direct to those sites, it takes me back to index.html
This is my index.php code:
<?php
/*
*
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
*
*/
include "app/config.php";
include "app/detect.php";
if ($page_name=='') {
include $browser_t.'/index.html';
}
elseif ($page_name=='index.html') {
include $browser_t.'/index.html';
}
elseif ($page_name=='es/index.html') {
include $browser_t.'/es/index.html';
}
else
{
include $browser_t.'/404.html';
}
?>
I am linking my site so that you say what I mean. In the top right corner there is a hyperlink that says "Español" and when you click it, it's supposed to take you to a Spanish version of the page you're currently on. Instead, it simply takes you to the index tab anew and it changes the subdirectory, but my translated page does not appear.
Inside the config.php I have the following:
<?php
/*
*
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
*
*/
$current_page_uri = $_SERVER['REQUEST_URI'];
$part_url = explode("/", $current_page_uri);
$page_name = end($part_url);
$email_id = "support@elitecomps.com";
?>
And I would add my detect.php code here but it is a large file and not the problem I am attempting to address so I will merely link it instead.
PS Everything is linked appropriately and I have triple checked everything. My only suspect left is my index.php which I am unsure of why.