which is the best sollution ?

Discussion in 'Site & Server Administration' started by 4forumsID, Nov 23, 2006.

  1. #1
    i have bought more extensions for the same domain :

    domain.com
    domain.net
    domain.org

    i bought them to have them point to the same content . .com is the main one bought some time ago

    which is the best sollution for doing this ?
    301 redirects from the other domains to .com domain ? or DNS redirects to the .com IP ?
     
    4forumsID, Nov 23, 2006 IP
  2. JoshuaGross

    JoshuaGross Peon

    Messages:
    411
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    301, so content isn't duplicated.
     
    JoshuaGross, Nov 23, 2006 IP
  3. 4forumsID

    4forumsID Peon

    Messages:
    162
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you , do you happen to have a model on how mod_rewrite should look for such a redirect ?



    thanks
     
    4forumsID, Nov 24, 2006 IP
  4. saadahmed007

    saadahmed007 Admínistratör

    Messages:
    5,272
    Likes Received:
    869
    Best Answers:
    0
    Trophy Points:
    380
    #4
    Hi,
    I've found a pretty good guide about it check it here
    Mod Rewrite should be enabled on your server!
    Saad
     
    saadahmed007, Nov 24, 2006 IP
  5. Caronet-Hesham

    Caronet-Hesham Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    can't you just have one main domain and park the other 2 on the same account?
     
    Caronet-Hesham, Nov 24, 2006 IP
  6. 4forumsID

    4forumsID Peon

    Messages:
    162
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I succeeded to make what i had in mind . here is an example for who wants in future:

    requirements: mod_rewrite (apache module), dns access, access to .htaccess

    
      <VirtualHost *:80>
       ServerName domain.org
       ServerAdmin webmaster@domain.org
       IndexOptions FancyIndexing
       DocumentRoot /var/www/somedir
       ServerAlias *.domain.org
            <Directory "/var/www/somedir">
                   Options Indexes FollowSymLinks
                    RewriteEngine On
    [COLOR="SeaGreen"]#subdomain.domain.org to subdomain.domain.com[/COLOR]
                    RewriteCond %{HTTP_HOST} ^(.+).[B]domain\.org[/B]$ [NC]
                    RewriteRule ^/?(.*)$ http://[B]%1.domain.com[/B]/ [R=301,L]
    [COLOR="SeaGreen"]# domain.org to www.domain.com[/COLOR]
                    RewriteCond %{HTTP_HOST} ^[B]domain\.org[/B]$ [NC]
                    RewriteRule ^/?(.*)$ http://[B]www.domain.com[/B]/ [R=301,L]
    [COLOR="SeaGreen"]#www.domain.org to www.domain.com[/COLOR]
                    RewriteCond %{HTTP_HOST} ^[B]www\.domain\.org[/B]$ [NC]
                    RewriteRule ^/?(.*)$ http://[B]www.domain.com[/B]/ [R=301,L]
            </Directory>
      </VirtualHost>
    
    Code (markup):


    Note: you must have in domain.org DNS zone a line like this: *.domain.org. IN CNAME domain.org.
     
    4forumsID, Nov 24, 2006 IP