| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Jan 2003
Posts: 53
![]() | 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. |
| |
| | #2 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | 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 |
| |
| | #3 (permalink) |
| NamePros Member Join Date: Jul 2003
Posts: 118
![]() | 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!!
__________________ Paulicon Web design - Your one stop shop |
| |
| | THREAD STARTER #5 (permalink) |
| NamePros Member Join Date: Jan 2003
Posts: 53
![]() | 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 |
| |
| | THREAD STARTER #6 (permalink) |
| NamePros Member Join Date: Jan 2003
Posts: 53
![]() | 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 |
| |
| | #7 (permalink) | ||||||||
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() |
![]() ????: NamePros.com http://www.namepros.com/showthread.php?t=15432 needs to be
| ||||||||
| |
| | THREAD STARTER #12 (permalink) |
| NamePros Member Join Date: Jan 2003
Posts: 53
![]() | 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 |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |