HTML Redirect delay and continual refresh issue

Discussion in 'HTML & Website Design' started by AMFsound, Oct 3, 2008.

  1. #1
    hey guys,

    I will admit I'm a novice, I'll save you the guess!...I'm trying to do a simple meta refresh redirect on a search engine page...

    this is my page viagrasearch.freehostia.com ....I'm trying to get it to go right to the "cheap viagra" option on the page, instead of having to select it from the main search engine page. So I go into freehostia's "file manager" and alter the "index" and "results' files...

    I replace(I'll highlight in red);

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Pharma</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="<%path%>styles.css" rel="stylesheet" type="text/css">
    </head>


    with;

    <META
    http-equiv="refresh"
    content="0;URL=http://viagrasearch.freehostia.com/index.php?qq=Cheap%20Viagra&tmpl=0102&theme=pharma">


    It does work(Yes!), however I can't seem to get it to redirect without stopping on the main search engine page before it does its redirect? I read somewhere to replace the "0" with "s" but that didn't have any effect....?

    Can anyone tell me how to affect an immediate redirect without stopping on the main search engine page..?

    Thanks guys...!
     
    AMFsound, Oct 3, 2008 IP
  2. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #2
    What about using javascript?

    <script type="text/javascript">window.location='http://viagrasearch.freehostia.com/index.php?qq=Cheap%20Viagra&tmpl=0102&theme=pharma';</script>
    Code (markup):

    The best solution would be to do a 301 redirect with PHP, .htaccess or within the control panel of your host.
     
    nfd2005, Oct 3, 2008 IP
  3. AMFsound

    AMFsound Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks NFD,

    I appreciate it...I simply am too much of a novice to put your suggestion into play. I can only handle a plain text editor for html at this point...

    I did go into the CP on the host, they allow to select the type of PHP 4 or 5 or 6, but no further alterable option seems to be available for PHP...

    If you have any other ideas I'm all ears.....
     
    AMFsound, Oct 4, 2008 IP
  4. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #4
    if your page is index.php, add this code to the very top before any other code:
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://viagrasearch.freehostia.com/index.php?qq=Cheap%20Viagra&tmpl=0102&theme=pharma" );
    ?> 
    PHP:
     
    nfd2005, Oct 4, 2008 IP
  5. AMFsound

    AMFsound Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks ndf,

    It does have a "index.php" file, when I put that code in and save it
    I get this error in firefox;


    Redirect Loop


    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.


    Maybe I should just accept that the HTML redirect will not redirect immediately and instead show an intermediary page, before switching to the desired destination page?......

    Any other ideas?
     
    AMFsound, Oct 4, 2008 IP
  6. nfd2005

    nfd2005 Well-Known Member

    Messages:
    295
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #6
    How about this:

    <?php
    if (!isset($_GET['qq'])) {
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://viagrasearch.freehostia.com/index.php?qq=Cheap%20Viagra&tmpl=0102&theme=pharma" );
    }
    ?>
    PHP:
     
    nfd2005, Oct 5, 2008 IP
  7. palme

    palme Active Member

    Messages:
    320
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #7
    put this script in the body of your start page

    <SCRIPT LANGUAGE="JAVASCRIPT"><!--
    manufacturer=navigator.appName
    version=navigator.appVersion;
    if (navigator.appName=="Netscape") // or Fire fox or Opera ...
    location.href ='your address';
    else
    if (navigator.appName=="Microsoft Internet Explorer")
    location.href ='your address';
    --></SCRIPT>
     
    palme, Oct 5, 2008 IP
  8. I-G4L

    I-G4L Peon

    Messages:
    312
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Why html direct?

    In your domain control panel, there should be a forwarding option.
     
    I-G4L, Oct 5, 2008 IP
  9. AMFsound

    AMFsound Peon

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    ndf thanks...!

    That second one did work.....! I really appreciate it...


    Thanks Palme....I'll keep that on file in case I ever have a problem with getting the php ....I might give it a whirl as I try to create more search engine pages..
    it's appreciated....I might as well test it, and play with it...

    thanks G4L, but they don't seem to have a forwarding option, maybe because it's a subdomain..not sure..I even did a search in their faq help area and came back nothing in terms of forwarding...kind of odd...

    thanks guys...!
     
    AMFsound, Oct 5, 2008 IP