Default HTML file

Discussion in 'Apache' started by mads, Jan 16, 2008.

  1. #1
    mads, Jan 16, 2008 IP
  2. reviewerjoe

    reviewerjoe Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    place a javascript redirect in your 404.html template on the old domain so when the users go there, they are immediately redirected to your new domain. [this is the asiest]

    If your looking to redirect them to a specific page then you're going to have to write a php redirect based on the old webpage extention and send it to the new domain based on the new domain. [Much more difficult this way].

    If this is what you're looking for and you're not that good a coding i would suggest just rebuilding your site infrastructure with a redirect page for webpage. [easier but time consuming]

    just do a google search for javascript redirect on google. Good example from tizag.
     
    reviewerjoe, Jan 18, 2008 IP
  3. boltok

    boltok Active Member

    Messages:
    257
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    78
    #3
    If you have access to your Apache configuration, or your .htaccess allows it, you can just add this:

    Redirect permanent / http://new.example.com/
    Code (markup):
     
    boltok, Jan 18, 2008 IP
  4. mads

    mads Well-Known Member

    Messages:
    762
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #4
    yes, that one is quite similar to the one I use... but I still can't make the original WP post adresses redirect to my new site :(

    I selected the PHP version:
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.newdomain.com/" );
    ?>

    Redirecting http://www.olddomain.com works fine. Problem is redirecting something like http://www.olddomain.com/my-old-page/.

    I can't make such addresses redirect - instead I get a wonderful 404 Not Found error :(

    What is the secret trick? (please be aware that some of my post names have changes when I moved to the new domain)
     
    mads, Jan 28, 2008 IP
  5. atomsplash

    atomsplash Peon

    Messages:
    167
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Use the .htaccess method if you can, you can make it wildcard redirect all subpages on the old domain to the new one.
     
    atomsplash, Jan 28, 2008 IP
  6. mads

    mads Well-Known Member

    Messages:
    762
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #6
    mads, Jan 29, 2008 IP