How to redirect my site ?

Discussion in 'Domain Names' started by jagjitsingh, May 9, 2008.

  1. #1
    how to redirect my site and a page with 301 and java script ? Please tell me step by step.
     
    jagjitsingh, May 9, 2008 IP
  2. GreatDomainRace

    GreatDomainRace Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try:

    <%
    response.setStatus(301);
    response.setHeader( "Location", "http://www.new-url.com/" );
    response.setHeader( "Connection", "close" );
    %>

    or

    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently" ;
    Response.AddHeader("Location","http://www.example.com/new_url") ;
    }
    </script>
     
    GreatDomainRace, May 9, 2008 IP
    Zerosleep likes this.
  3. MarceloBR

    MarceloBR Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Doesn't it require htaccess?
     
    MarceloBR, May 9, 2008 IP
  4. GreatDomainRace

    GreatDomainRace Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also do a .htaccess 301 redirect with:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    or if you want to point domain.com to www.domain.com

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
     
    GreatDomainRace, May 9, 2008 IP
  5. shivon

    shivon Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    as easy as that :p
     
    shivon, May 9, 2008 IP
  6. GreatDomainRace

    GreatDomainRace Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hopefully :)
     
    GreatDomainRace, May 9, 2008 IP
  7. GreatDomainRace

    GreatDomainRace Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If you do the .htaccess 301 redirect. You will have to wait for apache to be restarted on your server before it will work.

    So if it doesn't work instantly, that may be the reason.
     
    GreatDomainRace, May 9, 2008 IP
  8. Zerosleep

    Zerosleep Established User

    Messages:
    7,999
    Likes Received:
    559
    Best Answers:
    1
    Trophy Points:
    405
    #8
    Thanks for that even I was looking for this topic :D how to redirect a domain :eek:

    reps for u :D
     
    Zerosleep, May 9, 2008 IP
  9. GreatDomainRace

    GreatDomainRace Peon

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Glad I could help :)
     
    GreatDomainRace, May 9, 2008 IP