1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How can you redirect someone to another page ??

Discussion in 'HTML & Website Design' started by munier, Mar 12, 2011.

  1. #1
    Hello,

    If I send visitors to one page, how can I automaticly redirect them to another page ?

    Example:

    I send visitors to www.mywebsite.com and than they automaticly go to: www.mywebsite.com/page2 ...

    How can I do this ? I heard something about meta refresh or something.

    OR is there a HTML code, that I can save as a .php, so when people visit that, they automaticly go to another page.

    Please help me out.
     
    munier, Mar 12, 2011 IP
  2. bsetclpvas

    bsetclpvas Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it is very easy , make a link on page and pass html query behind it. u must be do this very easily.

    if u wana more help go on w3schools site

    it have all training abt html
    take care bye
     
    bsetclpvas, Mar 12, 2011 IP
  3. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    Thank you,

    But can someone please tell me exactly what I have to do :S ?

    Please tell me step-by-step, and where I have to put the links etc. etc.
     
    munier, Mar 12, 2011 IP
  4. kevbo22

    kevbo22 Active Member

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Put this at the top of your page:
    <?
    header('Location: http://www.example.com/');
    ?>
    This will send a visitor to the url given.
     
    kevbo22, Mar 12, 2011 IP
  5. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    Oke thank you!

    And I have to put this code at the top of the header.php file right ? or no ??

    Please let me know in which file I have to place this :p
     
    munier, Mar 12, 2011 IP
  6. kemonrider

    kemonrider Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    try this :

    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomainhere.com/index.html">

    place the code above between <head> </head>
    The content="0; may be changed to the number of seconds you want the browser to wait before redirecting.
     
    kemonrider, Mar 12, 2011 IP
  7. bsetclpvas

    bsetclpvas Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    hi,


    for reply me


    u have to past the link from where u want to redirect the page.

    for example

    if u want to redirect fro pgae 1 to 2nd.

    u have to paste link on page first with its name.
    just which these codes<a and </a and href<>
     
    bsetclpvas, Mar 12, 2011 IP
  8. FallenShadow

    FallenShadow Active Member

    Messages:
    230
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    90
    #8
    To automatically redirect someone from one link to a different page, just add this to the top of the page, BEFORE the <HTML> tag.

    <?
    $URL="YOUR URL HERE";
    header ("Location: $URL");
    ?>

    That's all it takes.
     
    FallenShadow, Mar 13, 2011 IP
  9. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #9
    Thank you for your help.

    But please tell me:

    Where do I have to past this code : <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomainhere.com/index.html"> ????

    I want to send visitors first to my homepage -> and than redirect them to another page.

    So where do I have to place this code, ( Which file ?, I tried to place it in the index.php file, but it doesn't work and there are no <head> </head> codes over there ).

    Please tell me.
     
    munier, Mar 13, 2011 IP
  10. kemonrider

    kemonrider Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    search for header.php or head.php there must be the <head> </head> tags belong.
     
    kemonrider, Mar 13, 2011 IP
  11. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #11
    Thank you, I placed the code in Header.php , but now I have this problem:

    I placed this code: <meta HTTP-EQUIV="REFRESH" content="3; url=http://www.yourdomainhere.com/index.html">

    Now, when someone visits the homepage, they automaticly go to the next page after 3 seconds.
    But the next page keeps refreshing everytime, after 3 seconds aswell.

    How can I make it stop refreshing the second page after it has been directed ?

    Please help me out?
     
    munier, Mar 13, 2011 IP
  12. kemonrider

    kemonrider Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    well, every files that take header.php will be redirected.
    revert your change on header.php, remove the script first.

    then you need to change your index.php page.
    copy the entire header.php content and paste it on index.php , then, apply the script on index.php
    and remove php script that call header.php in index.php

    if that's a bit complicated for you, just PM admin or cpanel username and password, and i will change it for you.
     
    kemonrider, Mar 13, 2011 IP
  13. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #13
    Is there another way to do this...

    This can't be this hard ... There must be an easier way :( ...

    I have placed the code in the header.php file and it is directing automaticly to the next page after 3 seconds.

    But WHY does the second page keeps refreshing :( ???

    ( Do I have to remove the word "refresh" from the code ??? ), or is there another solution ?
     
    munier, Mar 14, 2011 IP
  14. FallenShadow

    FallenShadow Active Member

    Messages:
    230
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    90
    #14
    As I said before, there's no need for anything Meta related or refresh related.

    Simple add this to the top of you page, above the <html> tags.

    <?
    $URL="YOUR URL HERE";
    header ("Location: $URL");
    ?>

    Put the URL in there and http://www.link1.com will automatically redirect to http://www.link2.com

    No refreshing.
     
    FallenShadow, Mar 14, 2011 IP
  15. deepspeed

    deepspeed Greenhorn

    Messages:
    92
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #15
    Perfect
    This will do!
     
    deepspeed, Mar 15, 2011 IP
  16. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #16
    FallenShadow,

    Thank you, can you please answer these small questions for me aswell :

    - Do I have to place this code in my Header.php file ?

    - I want the visitor to see the first page for 3 seconds, than after 3 seconds they get automaticly directed to the other page.

    - And how can I redirect to more than one page ? Like page1 links automaticly to: page2, page3, page4, page5. ( It choses randomly a link, and links to it ).

    Please help me out.
     
    Last edited: Mar 17, 2011
    munier, Mar 17, 2011 IP
  17. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #17
    I've tried many different codes and realised this code is the really good:

    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomainhere.com/index.html">

    The page does get directed to the right page, But the only problem is:

    after it goes to the second page, it automaticly refreshes the page every 3 seconds.

    How can I make it stop refreshing the second page ?

    Please help me out !!!
     
    munier, Mar 17, 2011 IP
  18. kemonrider

    kemonrider Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    like i said, just put the code in the page you want to redirect. And make sure you put it between <head> and </head>
    Don't put it on header.php

    Copy all the content inside header.php and paste it on the very first line of the page you want to redirect (eg:index.php)
    and remove code <? include 'header.php' ?> from index.php

    it should work.
     
    kemonrider, Mar 17, 2011 IP
  19. ACME Squares

    ACME Squares Peon

    Messages:
    98
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #19
    It's best to specify what type of redirect you want.
    header('Location: http://www.example.com', true, 301);
    ...for a permanent redirect, and 307 for temporary.
     
    ACME Squares, Mar 17, 2011 IP
  20. munier

    munier Member

    Messages:
    154
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #20
    Oke this is exactly what I want :

    - I want to buy visitors ( bulk traffic ) and send them to my home page.

    - Than once they get there, they should automaticly be directed to homepage.com/page2 . ( after 3 seconds ).

    - But the second page SHOULD not be refreshed after 3 seconds.

    How can I do this ?

    This code works good: <meta HTTP-EQUIV="REFRESH" content="3; url=http://www.yourdomainhere.com/index.html">

    But I don't want it to refresh the second page ...

    Please don't make it to complicated :(
     
    munier, Mar 17, 2011 IP