NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How do these web redirection scripts work?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-22-2003, 10:55 AM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



How do these web redirection scripts work?


Good Morning, I'm a big rookie web designer and I created my website for 3 different sizes/resolutions (640x480, 800x600, 1024-768). I found all these web redirection scripts on the web, that redirect the user to the right size/rez for thier montior but Im a bit confused. Does this mean I have to register 3 individual web domain names for these scripts to work? I have one www.myname.com site registered already, and I wouldnt want to purchase/register a bunch of others, I thought the redirect script could work with 1 domain name, or am I wrong? Does someone know how these types of scripts work?

Thank you for your time.
Rhino1616 is offline  
Old 10-22-2003, 11:18 AM   #2 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
in the script there should be a bit defining your domain of the page

simply put the 3 different websizes in 3 folders

eg

640
800
1024

and in the domain do it so that the 800x600 thingy is www.domain.com/800
adam_uk is offline  
Old 10-22-2003, 01:55 PM   #3 (permalink)
NamePros Member
Join Date: Jul 2003
Posts: 118
web guru is an unknown quantity at this point
 



Right if you want to do different sites for each screen res then just follow adams instructions. But my advice is to just do one site for 800x600, as this is the size that most people have. Any site I design I use 800x600. The problem with doing three differnet sites for the differenet screen res is one that it takes up a lot of space o your server (Three times as much), but most importantly most search engine bots wont index your sites as they dont like this type of redirection on your index page.

Just a few points you should consider!!
web guru is offline  
Old 10-23-2003, 09:18 AM THREAD STARTER               #4 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Thanks for the info, Ill look into it & if i have any problems Ill get back to you.
Rhino1616 is offline  
Old 10-23-2003, 04:04 PM THREAD STARTER               #5 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi everyone. I tried the advice you gave and it seems to kinda work, what I mean is that it does redirect the page, unfortunately I designed my website in frames. My webpage has 3 frames a banner, middle/body, and a footer. I added the script to the middle frame because I cant & dont know where to add the script in the index page of a framed website, or if you can even add the script to the index page of a frames website. The script I added looks like this:

<script language="JavaScript1.2">
<!--

if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://uniteddistributorscanada.hypermart.net/")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://uniteddistributorscanada.hypermart.net/")

else if (screen.width==1024||screen.height==768) //if 1024x768
window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768")

else //if all else
window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768")

//-->
</script>

If you go to the website you'll notice depending on the resolution that you have the entire new page is redirected into the main body of the framed site (where I added the script). Is there any way to fix this, and have the whole page redirect. You can view the website at: http://uniteddistributorscanada.hypermart.net/
????: NamePros.com http://www.namepros.com/programming/15432-how-do-these-web-redirection-scripts.html

Thank you

PS: heads up on the pop ups
Rhino1616 is offline  
Old 10-24-2003, 01:02 PM THREAD STARTER               #6 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi guys, I think Im almost there. I added a free script I found on the web to my index.htm page and it looks like this:

<script language="JavaScript1.2">
<!--

/*
Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/ )
Submitted to Dynamicdrive.com to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/


if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.netscape.com")

else if (screen.width==640||screen.height==480) //if 640x480
window.location.replace("http://www.microsoft.com")

else if (screen.width==1024||screen.height==76 //if 1024x768
window.location.replace("http://www.dynamicdrive.com")

else //if all else
window.location.replace("http://freewarejava.com")

//-->
</script>


So I just altered the script and added the urls to it, and this is what it looks like in my index page:


<script language="JavaScript1.2">
<!--

/*
Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/ )
Submitted to Dynamicdrive.com to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/


if (screen.width==800||screen.height==600) //if 800x600
window.location.replace("http://www.uniteddistributors.ca")

else if (screen.width==640||screen.height==480) //if 640x480
????: NamePros.com http://www.namepros.com/showthread.php?t=15432
window.location.replace("http://www.uniteddistributors.ca")

else if (screen.width==1024||screen.height==76 //if 1024x768
window.location.replace("http://www.uniteddistributors.ca/1024x768/")

else //if all else
window.location.replace("http://www.uniteddistributors.ca/1024x768/")

//-->
</script>


I added to the frames index.htm page & tested it out, and it seemed to work perfectly. I did a few other touch ups and uploaded it & when I viewed it, it didnt redirect. If your rez is at 800x600 and you visit the site at: http://www.uniteddistributors.ca/ it looks alright, but if your rez is 1024x768 it wont redirect to the 1024x768. I tested it out to see if the pages are on the web by typing the url directly and its there: http://www.uniteddistributors.ca/1024x768/
Do you know, whats wrong? I have a funny feeling its something very simple. If there's any help you can give I'd appreciate it.

Thank you
Rhino1616 is offline  
Old 10-24-2003, 01:56 PM   #7 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
Quote:
screen.width==1024||screen.height==76
wow thats wide screen
????: NamePros.com http://www.namepros.com/showthread.php?t=15432


needs to be

Quote:
screen.width==1024||screen.height==768
adam_uk is offline  
Old 10-24-2003, 02:32 PM THREAD STARTER               #8 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



HA,HA,HA,HA.I almost died laughing when you helped me notice that. I look into it right away.

Thanks adam_UK
Rhino1616 is offline  
Old 10-24-2003, 02:37 PM THREAD STARTER               #9 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



I'm back. Would you believe it adam, but that was just a typo error in my post. It says 786 in my file not 76 like it shows on the post. strange I wonder whats wrong?
Rhino1616 is offline  
Old 10-24-2003, 03:53 PM THREAD STARTER               #10 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



Hi guys. I finally got it working . I wanted to thank you guys for the time and help you gave me.

Thanks again
Rhino1616 is offline  
Old 10-25-2003, 03:39 AM   #11 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
no problem, what was wrong?
adam_uk is offline  
Old 10-27-2003, 09:51 AM THREAD STARTER               #12 (permalink)
NamePros Member
Join Date: Jan 2003
Posts: 53
Rhino1616 is an unknown quantity at this point
 



It was all a typo & placement error on my part, The url to redirect to was wrong & typed wrong, and i accidently uploaded 2 index.htm pages to my main site on the web, which confused the redirect javascript that i add to my webpage.

Thanks again for the help
Rhino1616 is offline  
Old 10-27-2003, 01:31 PM   #13 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
ah right cool
adam_uk is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:53 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger