Subdomain redirect to WWW

Posted by manix on Pro Webmasters See other posts from Pro Webmasters or by manix
Published on 2012-09-06T04:05:35Z Indexed on 2012/09/06 9:50 UTC
Read the original article Hit count: 237

Filed under:
|
|

I have the domain example.com and the test.example.com running on apache server. For some reason when I try to visit test.example it is redirected to www.test.example and by consequence a Server not found error is displayed in the browser. Both .htaccess (root and subdomain folder) files are empty.

Additional facts

I have another subdomain xyz.example.com pointed to public_html/xyz directory with some content inside (index.html with "hello world message") and it works fine if I use xyz.example.com instead of www.xyz.example.com. So, can you help me to point to the right direction in order. I have a vps and I am able to change any file if is required.

Below you can find my virtual host configuration.

<VirtualHost xx.xxx.xxx:80>
    ServerName test.example.com
    ServerAlias www.test.example.com
    DocumentRoot /home/example/public_html/test
    ServerAdmin [email protected]
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/test.example.com combined
    CustomLog /usr/local/apache/domlogs/test.example.com-bytes_log "%{%s}t %I  .\n%{%s}t %O ."

    ScriptAlias /cgi-bin/ /home/example/public_html/test/cgi-bin/

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/example/test.example.com/*.conf"

</VirtualHost>

© Pro Webmasters or respective owner

Related posts about apache

Related posts about redirects