I'm getting a 404 when typing my domain in the address bar without www in front of it. Only Safari on a Mac seems to work fine, but Chrome and Firefox get a 404 not found. Why is that, and how to I change it?
domain.nl works in Safari but returns 404 in Chrome/Firefox/etc.
www.domain.nl works in all browsers.
The non-www version does not automatically change to the www version in Chrome/Firefox/etc.
RewriteEngine On
# AUTO HTTP TO HTTPS
RewriteCond %{HTTP_HOST} ^domain\.nl$
RewriteRule ^(.*) http://www.domain.nl/$1 [R=301]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
# FOR NON-WWW QUERIES
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R=301,L]
Please note: I have replaced the actual domain with the text "domain" in the code.