need help in redirect

by alonpy
4 replies
  • WEB DESIGN
  • |
Hi,

I need to know how I can have a page that redirect the user to another domain. Let say I have a site www[dot]mysite[dot]com/page123, I will link to this page from anywhere and when the surfer click on that link he will be redirect to www[dot]program[dot]com.
#redirect
  • Profile picture of the author JMartin
    If you have PHP use, you can just make a page called index.php or whatever and enter this in the file:

    Code:
    <?
    header("location:http://www.SITE.com");
    ?>
    That will redirect the person to SITE.com when s/he hits the file.

    Example:

    Let's say I just bought site.info and I want to redirect people hitting site.info to site.com, I'd put that above code in index.php and upload it to the main directory of site.info.

    Now, when someone visits site.info in any way, they get redirected to site.com.
    {{ DiscussionBoard.errors[856487].message }}
    • Profile picture of the author Aaron Sustar
      Well, you can always use a .htaccess file for that. Create a text document, type in something like this
      Code:
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^page123$ index.php [L,R=301]
      </IfModule>
      and save it as ".htaccess". Then upload this file to your server.
      {{ DiscussionBoard.errors[857754].message }}
  • Profile picture of the author alonpy
    Is there a HTML code for that?
    {{ DiscussionBoard.errors[861207].message }}
  • Profile picture of the author howdoyou
    just login to your cpanel and click on "redirect links". if you don't have cpanel, any of the two methods above will work just fine.
    {{ DiscussionBoard.errors[861342].message }}

Trending Topics