Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

apache config file

in my dns www.mysite.com and
mysite.com has identical IP-s.
however in the browser typing
www.mysite.com shows site
while mysite.com not.
how should I change settings?
my virtualhosh looks like this:

<VirtualHost www.mysite.com>
DocumentRoot /www/docs/abc
ServerName www.mysite.com
</VirtualHost>

Thanks
0
kako
Asked:
kako
1 Solution
 
lexxwernCommented:
perhaps create one more virtualhost

<VirtualHost mysite.com>
DocumentRoot /www/docs/abc
ServerName mysite.com
</VirtualHost>

Helped?

lhn
0
 
samriCommented:
Or, you can skip VirtualHost at all, unless you have other VirtualHost hosted under the same Apache.

Or straight from httpd.conf (mine was Apache 1.3.23 Win32).   This should take care in a scenarios where you clients might be using IP address (most unlikely, but it is possible).

# Use name-based virtual hosting.
#
#NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
0
 
fauzdarCommented:
you just have to define

<VirtualHost www.mysite.com>
DocumentRoot /www/docs/abc
ServerName www.mysite.com
ServerAlias *.mysite.com
</VirtualHost>

0
 
kakoAuthor Commented:
what means "*"?
does it means that any
xxx.mysite.com com will be redirected to www.mysite.com,
or only mysite.com?
0
 
fauzdarCommented:
well it will eliminate the problem of showing www.mysite.com and not showing mysite.com.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now