Redirect all previous subdomains to main domain

Discussion in 'Site & Server Administration' started by StoreMyPic, Jul 29, 2009.

  1. #1
    Hello

    I previously had 5 subdomains which i removed and want all to redirect to main domain like

    sub1.domain.com to domain.com
    sub2.domain.com to domain.com
    sub3.domain.com to domain.com
    sub4.domain.com to domain.com
    sub5.domain.com to domain.com

    i.e i want to redirect all sub domain to main one

    and also i want to

    sub1.domain.com/info.html to domain.com

    &

    sub2.domain.com to domain.com/sub2

    how should do this
     
    StoreMyPic, Jul 29, 2009 IP
  2. SA-ChrisM

    SA-ChrisM Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Depending on how your hosting setup, these directions may need to be modified just a bit. However in each of the roots for your subdomains, you can create an .htaccess file with the following

    Redirect 301 /index.html http://www.domain.com
    Code (markup):
    When someone goes to the subdomains, they'll be redirected to the main domain. You can tweak this a bit for however you want to redirect.
     
    SA-ChrisM, Jul 29, 2009 IP