GetSimple Support Forum
Redirection page - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Redirection page (/showthread.php?tid=277)



Redirection page - __fabrice - 2010-01-08

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


Redirection page - ccagle8 - 2010-01-08

wouldn't this be better served by using a conditional stylesheet?

http://css-tricks.com/how-to-create-an-ie-only-stylesheet/


Redirection page - __fabrice - 2010-01-08

Hi,

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

Fab.


Redirection page - Nijikokun - 2010-01-08

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";
        }
    }



Redirection page - __fabrice - 2010-01-08

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


Redirection page - Nijikokun - 2010-01-08

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.


Redirection page - __fabrice - 2010-01-09

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.