www.domain redirecting to google?

Posted by aayush on Pro Webmasters See other posts from Pro Webmasters or by aayush
Published on 2013-11-03T15:05:32Z Indexed on 2013/11/03 16:12 UTC
Read the original article Hit count: 216

Filed under:
|

Note: A while back i had no place to host my domain, then via namecheap i set it to forward my domain to google

I bought webhosting again today and everything was working fine. I set up vhosts and set up www.domain as the server alias. Both worked. Then i tried to set up a alternate subdomain test.domain, but failed (I did it by creating a alternate vhost right below the current one) as it kept redirecting to google. As a test, i replaced the www with test in serveralias, it still redirected to google but now even www redirects to google.

I am using cloudflare, and i am really confused how to go about this. I tried listing www as a cname and as a A record, still redirecting to google. I tried checking via proxies e.t.c, its universal and hence not a problem of my PC.

Please help, i am really distressed by this. I am running a ubuntu 13.10 x32 stack with LAMP. Here is what my domain.com.conf file looks like

    <VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName domain.com
        ServerAlias www.domain.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/domain.com/public_html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

There is a valid index.php file at the end of the documentroot aswell. The website in question is aayushagra.com

Edit: On cloudflare i tried removing the www entirely, and it still sent me to google

Edit: Zone file

;; Domain:     aayushagra.com
;; Exported:   2013-11-03 07:37:52
;; 
;; This file is intended for use for informational and archival 
;; purposes ONLY and MUST be edited before use on a production 
;; DNS server.  In particular, you must: 
;;   -- update the SOA record with the correct authoritative name server 
;;   -- update the SOA record with the contact e-mail address information
;;   -- update the NS record(s) with the authoritative name servers for this domain.
;; 
;; For further information, please consult the BIND documentation
;; located on the following website:
;; 
;; http://www.isc.org/
;;     
;; And RFC 1035:
;; 
;; http://www.ietf.org/rfc/rfc1035.txt
;; 
;; Please note that we do NOT offer technical support for any use
;; of this zone data, the BIND name server, or any other third-party 
;; DNS software.
;; 
;;     Use at your own risk. 
;; 
$ORIGIN aayushagra.com.
@   3600    IN  SOA aayushagra.com. root.aayushagra.com.    (
        2013110301  ; serial
        7200        ; refresh
        3600        ; retry
        86400       ; expire
        3600)       ; minimum



;; MX Records
aayushagra.com. 300 IN  MX      aayushagra.com.

;; CNAME Records
direct.aayushagra.com.  300 IN  CNAME   aayushagra.com.

;; A Records (IPv4 addresses)
www.aayushagra.com. 300 IN  A   146.185.140.31
aayushagra.com. 300 IN  A   146.185.140.31

© Pro Webmasters or respective owner

Related posts about apache

Related posts about dns