RE: website without www is 404
03-30-2015, 08:01 PM
(This post was last modified: 03-30-2015, 08:01 PM by apinto.
Edit Reason: Formatting.
)
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):
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
What you need to check is the ServerAlias directive, the rest is here only for reference.
Please note that your VirtualHost may differ a LOT from the above example (usually it has much more lines).
Hope this helps you.
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:
- You have a A Record entry for yourdomain.com and for www.yourdomain.com.
- Both entries are using the same IP Address (either IPv4 and/or IPv6 if applicable).
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.
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora
Graphic and Web Design. Development.
www.vanguardly.com
[Module] Mail Quota Count | Vagrant Box with Sentora
Graphic and Web Design. Development.
www.vanguardly.com