I am getting a strange behaviour while trying to setup an apache2 virtual host with mod_rewrite for an angular2 app.
I am not using HashLocationStrategy, http://host.tld/#page
but the default LocationStrategy http://host.tld/page
, which obviously needs mod_rewrite enabled and setup correctly.
The local url I am trying to reach is http://calendar.atlas.local/
My console shows some (not all) requests to http://www.calendar.atlas.local/
while trying to load some of the components, which is weird.
Here is my .htaccess
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /index.html [NC,L]
</IfModule>
Here is my .conf for apache2 on OSX El Capitan
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Dev/NG-CAL/"
ServerName calendar.atlas.local
ErrorLog "/private/var/log/apache2/calendar.local-error_log"
CustomLog "/private/var/log/apache2/calendar.local-access_log" common
<Directory "/Library/WebServer/Dev/NG-CAL/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I have no idea where the "www" comes from.