how to access my website also with "www"?
Hi!
On my apache2 I have a few websites. Everything works fine except that the websites can only be reached without "www". for examle: http://mywebsite.com works, but www.mywebsite.com doesn't. Is it due to the configuration in http.conf or due to the DNS configuration? thank you. |
It could due to anyone or both. Try to resolve www.mywebsite.com and if you cannot then it's your dns. If you can then it's httpd.conf
|
try to add following line in your /etc/hosts file
xxx.xxx.xxx.xxx(your webserver ip) www.mywebsite.com If you website display correctly mean you need to update your dns data (Add www into database) |
thanks for the answers.
Quote:
|
Are you trying to connect locally or from another computer?
|
Are you trying to access that website from a computer outside of your LAN?
If so, you'll need to have the domain name that you are trying to use registered with a domain registrar. Then you will need to ensure that you have a www line in your DNS for that domain that points to that server's IP address. Example: mywebsite.com. 1H IN A ###.###.###.### www.mywebsite.com. 1H IN A ###.###.###.### Then you will need to ensure that your httpd.conf or virtual host file is configured to "listen" for the www as part of the URL. Example: ServerName mywebsite.com ServerAlias www.mywebsite.com |
If you add record inside /etc/hosts file result still the same, I believe the problem come from your httpd.conf. Try to check the virtual host section, change or add virtual www.mywebsite.com
|
In your domain's DNS zone file, add CNAME(s):
Code:
; Aliases This principle as well would apply if you want to have SMTP and POP3 hosts and as example. Code:
; Aliases ---------- |
All times are GMT -5. The time now is 03:39 AM. |