okay i have a site and want to show a different site to each browsers. so say i want Site A to only be seen by chrome and firefox and i want Site B to only be seen by IE and Opera.
I think it is possible, with JavaScript can do this may be, determine browser and do what you want. Webmasters may have other option I guess.
yeah i figured it can be done with javascript, But i have no clue to how to even begin this, i looked at some scripts googling but most of em are from like 2004 that didnt work when i tried to put them on my test site
This would normally be done server side by detecting the user agent string. This is also considered bad practice unless you have some reason for promoting a product specific to a browser. User agent strings aren't highly reliable overall since they can be spoofed.
Yes, is there any specific reason to do so? It's kinda strange. Server side is the best option.I did on something similar note but on the frontend using JavaScript.
i got to do this cause i just got tired of trying to fix my landing page to work on both IE and Opera, they just refuse to show my iframe.
You right man, it just got me beat lol but now im back with my motivation to fix it cause i dont like the browser redirection idea really. and plus eventually i will have to figure it out. maybe ill post my site source and someone can help me. but anyways for anyone need a answer for i originally asked, here something i came across i tweaked it a bit to fit my needs, but it redirects by detect the user agent. <html> <script> if(navigator.userAgent.indexOf("Firefox") != -1) { window.location = "http://yahoo.com/"; } else if(navigator.userAgent.indexOf("MSIE") != -1) { window.location = "http://youtube.com/"; } else if(navigator.userAgent.indexOf("Netscape") != -1) { window.location = "http://bing.com/"; } else if(navigator.userAgent.indexOf("Chrome") != -1) { window.location = "http://google.com/"; } else if(navigator.userAgent.indexOf("Opera") != -1) { window.location = "http://stagevu.com/"; } else { window.location = "http://hulu.com/"; } </script> </html> Code (markup):