Posts: 7
Threads: 2
Joined: Dec 2009
Hi,
I would to redirected the index.php page (template.php) to a page named 'ie6.php' if the browser is IE6 :
Code:
$browser = @get_browser(null, true);
if ($browser) {
$browser = trim($browser['browser_name_pattern']);
} else {
$browser = trim($_SERVER['HTTP_USER_AGENT']);
}
if (strpos($browser,'MSIE 6.0') !== FALSE) {
header('location:ie6.php');
}
But, but, for example, it's better to use mod_rewrite
Code:
header('location:http://my-web-server/ie6');
How can I do this ?, use the get_page_url() ? it's seems not. Where the url mod_rewrite pages are write (data/my-page.xml) ?
Regards,
Fabrice
Posts: 1,848
Threads: 86
Joined: Aug 2009
wouldn't this be better served by using a conditional stylesheet?
http://css-tricks.com/how-to-create-an-i...tylesheet/
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 7
Threads: 2
Joined: Dec 2009
Hi,
Yes, indeed. I know conditionnal stylesheet. But it isn't the question
Fab.
Posts: 111
Threads: 14
Joined: Jan 2010
In
index.php
integration with this code:
Code:
// get page id (url slug) that is being passed via .htaccess mod_rewrite
if (isset($_GET['id'])) {
$id = strtolower($_GET['id']);
} else {
$id = "index";
}
Integration:
Code:
$browser = @get_browser(null, true);
// check browser
if ($browser)
{
$browser = trim($browser['browser_name_pattern']);
}
else
{
$browser = trim($_SERVER['HTTP_USER_AGENT']);
}
// are they ie 6?
if (strpos($browser,'MSIE 6.0') !== FALSE)
{
$id = "ie6";
}
else
{
// get page id (url slug) that is being passed via .htaccess mod_rewrite
if (isset($_GET['id']))
{
$id = strtolower($_GET['id']);
}
else
{
$id = "index";
}
}
Posts: 7
Threads: 2
Joined: Dec 2009
Hi,
thanks, but the code in the index.php
don't change anything at all. There's the same behavior if I comment the code or not.
If i do that (in the template.php):
Code:
// get page id (url slug) that is being passed via .htaccess mod_rewrite
if (isset($_GET['id']))
{
$id = strtolower($_GET['id']);
}
else
{
$id = "index";
}
}
header('location:'.$id.'.php');
,the page is redirected to
/ie6.php,
not to /theme/my-theme/ie6.php.
Fab
Posts: 111
Threads: 14
Joined: Jan 2010
In your post you didn't detail where you wanted it to redirect to just how.
If you go into detail about the expectations you are looking for we can help you better.
Posts: 7
Threads: 2
Joined: Dec 2009
Hi,
Ok, so I would like
that the page was redirect to
/theme/my-theme/ie6.php NOT to /ie6.php.
So I can write my page with the same design .
Thanks you
F.