Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirection page
#1
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
Reply
#2
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!
Reply
#3
Hi,

Yes, indeed. I know conditionnal stylesheet. But it isn't the question Smile Big Grin

Fab.
Reply
#4
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";
        }
    }
http://nijikokun.com
random stuff. idk.
Reply
#5
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
Reply
#6
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.
http://nijikokun.com
random stuff. idk.
Reply
#7
Hi,

Ok, so I would like Smile 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.
Reply




Users browsing this thread: 2 Guest(s)