Redirect question

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

  1. #1
    Posted this in the wrong section before.

    I have my entire 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 much appreciated!
     
    flipster, Mar 12, 2010 IP
  2. vinoth.t

    vinoth.t Peon

    Messages:
    156
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use the below code in your .htaccess file
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.mysite.net$
    RewriteRule ^(.*) http://www.mysite.com/$1 [L,R=301]
     
    vinoth.t, Mar 16, 2010 IP