Quick help: redirecting a domain to another

Discussion in 'Programming' started by flipster, Mar 12, 2010.

  1. #1
    I believe this is the right section.

    I have all my website on www.mysite.com. What I want to do is buy www.mysite.net and redirect each identical page from www.mysite.net to www.mysite.com. I don't want to load a duplicate of my site onto www.mysite.net.

    I can't explain it well so here's what I mean:

    www.mysite.net/page1 --> www.mysite.com/page1
    www.mysite.net/page2 --> www.mysite.com/page2
    www.mysite.net/page3 --> www.mysite.com/page3
    www.mysite.net/page4 --> www.mysite.com/page4

    So I want the .net to redirect to my actual site at the .com without loading my entire site on the .net. So I just want redirects. I understand I'll probably have to use .htaccess right?

    Something like this correct?: Redirect 301 /page1 http://www.mysite.com/page1

    However, I have 8000 links on my website, so there has to be a way to make it quicker instead of doing each one page by page.

    If anyone can please advise, it is must appreciated!
     
    flipster, Mar 12, 2010 IP
  2. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Last edited: Mar 12, 2010
    NeoCambell, Mar 12, 2010 IP
  3. flipster

    flipster Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All you do is send me to your forum?

    You still didn't answer my question.
     
    flipster, Mar 13, 2010 IP
  4. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.mysite\.com
    RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
    Code (markup):
    Place this text in your .htaccess file of the old domain.
    Carefully note that I just did a text replacement on the post I mentioned. I thought it is a simple thing :confused:
     
    NeoCambell, Mar 14, 2010 IP