Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Cloned complete project repository on my server.
- # Installed dependencies using
- npm install.
- # Build using command and it created a dist directory.
- ng build --prod
- # Changed apache root to /var/www/html/dist directory.
- # Enabled mod_rewrite, restarted apache and added this .htaccess in my dist directory.
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- RewriteRule ^index\.html$ - [L]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule . /index.html [L]
- </IfModule>
- # jika di htdoc/www di dalam sub direktori sbb:
- # To host in a sub directory with apache, you can just do this:
- # Build command similar to this:
- ng build --base-href /myapp/
- # atau
- ng build --prod --configuration production --base-href /myapp/
- # .htaccess file would look like this
- RewriteEngine On
- RewriteBase /myapp/
- Options +FollowSymLinks
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*)$ index.html [L,QSA]
- # note:
- # .htaccess ditaruh di root htdoc/www
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement