Host Detect Script

Gidday all, I run a PC and a mobile website and want to detect the visitors host and then send to an appropriate folder.<br /><br />Eg, mobile hosts like docomo.ne.jp would go to /mobile/ and abc.com would go to /phpwebsite/ folder.<br /><br />Any info on what to do, where to go etc would be appreciated.<br /><br />Cheers, Wayne Rock Sign<!--content-->
Wayne, I wouldn't try where they are coming from. I would try brower detection and then send them to the appropriate section of your site.<br /><br />Google for "browser detection" and I am sure you will find something you can use.<!--content-->
Thanx for cutting back the foliage and showing me the way. Im off to explore.<br /><br />Wayne <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/ph34r.gif" style="vertical-align:middle" emoid=":ph34r:" border="0" alt="ph34r.gif" /><!--content-->
And exploring I did. Was reading thru Japanese BBS threads and got the following...I added to .htaccess<br /><br />RewriteEngine on<br />RewriteCond %{HTTP_USER_AGENT} ^DoCoMo [NC,OR]<br />RewriteCond %{HTTP_USER_AGENT} ^J-PHONE [NC,OR]<br />RewriteCond %{HTTP_USER_AGENT} ^KDDI [NC,OR]<br />RewriteCond %{HTTP_USER_AGENT} ^UP.Browser [NC,OR]<br />RewriteCond %{HTTP_USER_AGENT} ^DDIPOCKET [NC]<br />RewriteRule ^.*$ <a href="http://www.fukuokaguide.com/mobile/index.html" target="_blank">http://www.fukuokaguide.com/mobile/index.html</a> [L]<br /><br />and then created a .htaccess in /Mobile to set a RewriteEngine off command.<br /><br />And work it did.<br /><br />Hope this is helpful to someone one day.<br /><br />Wayne <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/kicking.gif" style="vertical-align:middle" emoid=":dance:" border="0" alt="kicking.gif" /><!--content-->
Nice going Wayne! Thumbs Up<!--content-->
 
Back
Top