1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Redirecting Subdomains to main domains

Discussion in 'Content Management' started by wptheme, Dec 3, 2010.

  1. #1
    Hi,
    I would like to ask if its possible for me to reddirect all of my subdomains to my main domains. Etc:

    1.example.com
    2.example.com
    >>> up to 100.example.com

    and redirect it all to
    example.com

    Green awaits for those with an answer.
    Thanks a bunch :)
     
    wptheme, Dec 3, 2010 IP
  2. guardian999

    guardian999 Well-Known Member

    Messages:
    376
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    Yes, it's possible.

    use header or meta http-equiv to redirect or using 301 permanent redirect
     
    guardian999, Dec 5, 2010 IP
  3. wptheme

    wptheme Well-Known Member

    Messages:
    4,051
    Likes Received:
    346
    Best Answers:
    0
    Trophy Points:
    180
    #3
    I want all the subdomains aside of www.example.com to redirect to www.example.com
     
    wptheme, Dec 5, 2010 IP
  4. babadorie

    babadorie Member

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    How to implement the 301 Redirect

    1. To create a .htaccess file, open notepad, name and save
    the file as .htaccess (there is no extension).

    2. If you already have a .htaccess file on your server,
    download it to your desktop for editing.

    3. Place this code in your .htaccess file:

    redirect 301 /old/old.htm http://www.you.com/new.htm

    4. If the .htaccess file already has lines of code in it,
    skip a line, then add the above code.

    5. Save the .htaccess file

    6. Upload this file to the root folder of your server.

    7. Test it by typing in the old address to the page you've
    changed. You should be immediately taken to the new
    location.
     
    babadorie, Dec 5, 2010 IP
    wptheme likes this.
  5. wptheme

    wptheme Well-Known Member

    Messages:
    4,051
    Likes Received:
    346
    Best Answers:
    0
    Trophy Points:
    180
    #5
    Hi, thanks rep+ but can this work on subdomains I don't know. Meaning if people just press randomly
    http://123123.example.com
    how to make sure they will be redirected to example.com?
    Will this technique work?
     
    wptheme, Dec 6, 2010 IP
  6. Greg Carnegie

    Greg Carnegie Peon

    Messages:
    385
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Greg Carnegie, Dec 9, 2010 IP
    wptheme likes this.
  7. wptheme

    wptheme Well-Known Member

    Messages:
    4,051
    Likes Received:
    346
    Best Answers:
    0
    Trophy Points:
    180
    #7
    wptheme, Dec 9, 2010 IP