This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs for server configuration, added root .htaccess
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
# If an existing asset or directory is requested go to it as it is | ||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] | ||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d | ||
RewriteRule ^ - [L] | ||
|
||
# If the requested resource doesn't exist, use index.html | ||
RewriteRule ^ /index.html | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Server configuration | ||
|
||
Angular2 application by default works with so called hashbangs. They made url look like `/#/window/111`. To change this to `/window/111` you need to use HTML5 browser history functionality and adjust your server configuration. | ||
|
||
## Apache2 | ||
|
||
Server configuration for Apache2 can be found in project root in `.htaccess`. | ||
|
||
## nginx | ||
|
||
In your `server {}` block use: | ||
|
||
``` | ||
root /var/www/root_project_dir; | ||
index index.html; | ||
location / { | ||
try_files $uri /index.html; | ||
} | ||
``` |