There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: redirect if using a text browser.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
tunten's Avatar
Junior Member with 10 posts.
 
Join Date: Nov 2005
Experience: Beginner
24-Nov-2006, 05:18 AM #1
Solved: redirect if using a text browser.
Hi guys

I have just built a site, it is a simple one page site built in fireworks an embedded in to the html. What I would like to do is redirect any one using a text browser to a text version of the site. I know you can use the meta tag http-equiv="refresh" but I am not sure how to first check the browser and send if necessary. I have a feeling it may be a java script command. If any one knows a piece of code for this task I would be very grateful.

regards Chris
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,202 posts.
 
Join Date: Oct 2006
24-Nov-2006, 06:13 AM #2
Does anybody still use text browsers?

Since php can easily detect what browser is being used than it would probably be easier with it.
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,083 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
24-Nov-2006, 06:14 AM #3
If your host allows you the use of PHP you could use this:

PHP Code:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'ENTER USER AGENT HERE') !== FALSE) { //Add the browser you wish to detect where it says "enter user agent here"
header("Location: http://site.com/textversion.html");
exit;

Eriksrocks's Avatar
Computer Specs
Senior Member with 1,859 posts.
 
Join Date: Aug 2005
Location: Minnesota
Experience: Advanced
24-Nov-2006, 10:14 AM #4
Quote:
Originally Posted by namenotfound
If your host allows you the use of PHP you could use this:

PHP Code:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'ENTER USER AGENT HERE') !== FALSE) { //Add the browser you wish to detect where it says "enter user agent here"
header("Location: http://site.com/textversion.html");
exit;

Yup, that's what you want. Put it at the very beginning of the non-text page and rename the page with an extension of .php so it would be like index.php instead of index.html.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:31 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.