i need redirecting my website to another plz help

Discussion in 'Site & Server Administration' started by gajendra.gets, May 4, 2008.

  1. #1
    hii
    i need to redirect one of my site to another. plz tell me the best method with code, i need to do for few days as my sever is down. help me plz
     
    gajendra.gets, May 4, 2008 IP
  2. choice

    choice Prominent Member

    Messages:
    5,444
    Likes Received:
    490
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    2
    #2
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    Code (markup):
    replace the domain.com and www.domain.com with the url you are redirecting to and place it in your .htaccess file
     
    choice, May 5, 2008 IP
  3. gajendra.gets

    gajendra.gets Guest

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanx a lot grouse. is any java script code for this too
     
    gajendra.gets, May 5, 2008 IP
  4. choice

    choice Prominent Member

    Messages:
    5,444
    Likes Received:
    490
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    2
    #4
    <%
    response.setStatus(301);
    response.setHeader( "Location", "http://www.new-url.com/" );
    response.setHeader( "Connection", "close" );
    %> 
    Code (markup):
    sure this is the java way of doing it
     
    choice, May 5, 2008 IP
  5. martinuk

    martinuk Active Member

    Messages:
    149
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    NOt 301 Because 301 means redirecting forever you should make a 404 page tell u visit what happened and tell them when recover
     
    martinuk, May 5, 2008 IP
  6. dpking

    dpking Peon

    Messages:
    1,021
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #6
    if the server is down you can simply change the DNS and upload the old data to new server !!
     
    dpking, May 5, 2008 IP