1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache Server I Want My sites to work on HTTP:// as Well As HTTP://.WWW

Discussion in 'Black Hat SEO' started by maxlinks, Jan 27, 2012.

  1. maxlinks

    maxlinks Junior Member

    Joined:
    Jul 4, 2011
    Messages:
    161
    Likes Received:
    5
    Occupation:
    sit at the desk all day
    Location:
    Los Angeles
    Sorry I have to reword my post a little better here goes.



    ok I changed the 000-default file in the sites enabled directory of apache to make my website point to www.xxxx.com not just http://xxxx.com,
    so that works my site can be found when typing www.xxxx.com

    but when I type http://xxxx.com it goes to the default web site on the server, thats not good, as I have many sites on the server.

    so what should I do to make my sites work on both www.xxx.com and http://xxxx.com
    at the very least I dont want people typing http://xxx.com and getting an entirely dierent web site (the default site)
     
  2. xinoanet

    xinoanet Regular Member

    Joined:
    Aug 8, 2009
    Messages:
    216
    Likes Received:
    30
    Location:
    Kitchener, Ontario
    I suppose you should do a 301 redirect using .htaccess file for each site
     
  3. dharmasp

    dharmasp Registered Member

    Joined:
    Jun 9, 2011
    Messages:
    54
    Likes Received:
    15
    Occupation:
    CEO
    Home Page:
    add the following to the configuration file for the particular site in /etc/apache2/sites-available/

    Code:
    ServerName  yoursite.com
    ServerAlias www.yoursite.com
    
    DirectoryIndex index.php
    DocumentRoot /path/to/your/site
    
    /etc/init.d/apache2 restart