![]() |
|
website without www is 404 - Printable Version +- Sentora Support Forums (https://senforums.mach-hosting.com) +-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5) +--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32) +---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36) +---- Thread: website without www is 404 (/showthread.php?tid=1353) |
website without www is 404 - adamhk0 - 03-30-2015 If I don't type www and my website is 404. I have to type www.mydomain.com to access my website. I wonder what is the reason cause this issue. Thanks. RE: website without www is 404 - apinto - 03-30-2015 It can have multiple causes, are you using any particular software on your website (like wordpress, joomla, etc)? Sometimes they change the .htaccess and might cause issues. Quick Fix for .htaccess: Try adding this to the .httaccess file (however this is probably NOT what you should fix, read below): Code: RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]Probably your issue is related to the DNS or VHOSTS setup, please check the following: DNS Setup:
V-HOSTS Setup: You should have something like this on your V-HOSTS file for yourdomain.com Code: <VirtualHost *>
ServerName www.yourdomain.com
ServerAlias yourdomain.com
</VirtualHost>Please note that your VirtualHost may differ a LOT from the above example (usually it has much more lines). Hope this helps you. RE: website without www is 404 - adamhk0 - 03-31-2015 Thanks for your reply. I am hosting multiple domains on my server. Each domain has a user account. All of the domains setting are the same. I tried the dns same setting on one of the domain, it works properly. For the domain that does not work properly, I have the following setting for the dns. At my domain resister nameservers are ns1.mydomain.com and ns2.mydomain.com. Both ns1.mydomain.com and ns2.mydomain.com are pointed to the same ip. At Sentora DNS Manager, I created dns records. It pretty much is default. For A record I have Host Name: @, mail, ns1, ns2 TTL: 3600, 86400, 17280, 17280. Target: my VPS IP. For CName Host Name: www, ftp, subdomains. TTL: 3600, 3600, 86400 Target: @, @, @ For the exactly same setting, it works on my other domains. For the Vhost, I never touch it. I have issue with one of the user account, not the zadmin account or zadmin domain. RE: website without www is 404 - apinto - 03-31-2015 Please check the Vhost for that domain. Also please confirm if that domain is using the sentora DNS (check that at domain registar). RE: website without www is 404 - adamhk0 - 03-31-2015 (03-31-2015, 06:59 AM)apinto Wrote: Please check the Vhost for that domain. I have CentOS 6 32bit. How to check vhost? Yes, I am using Sentora DNS Manger. Sentora DNS Manger created nameservers (ns1.mydomain.com and ns2.mydomain.com). At domain register, I have my domain nameservers set as ns1.mydomain.com and ns2.mydomain.com And both nameservers (ns1.mydomain.com and ns2.mydomain.com) are pointed to my VPS ip. Thank you. RE: website without www is 404 - adamhk0 - 04-01-2015 After I changed @ to mydomain.com in CName record at Sentora DNS Manger. The website show up properly. Before Host Name:www Target: @ After Host Name:www Target: mydomain.com RE: website without www is 404 - apinto - 04-01-2015 Glad to see it is fixed ![]() Bt the way, VHosts is at /etc/sentora/configs/apache Be careful if you edit it because it can break things. RE: website without www is 404 - adamhk0 - 04-02-2015 I just don't get it. @ equal mydomain.com, correct me if I am wrong. Can someone explain it? RE: website without www is 404 - TGates - 04-02-2015 Please do not double post your issues. (Other post removed, continue here) |