From 0acc0da6ec593cb6b580676063f69bdbceabdebe Mon Sep 17 00:00:00 2001 From: GotPPay Date: Fri, 22 Jun 2018 12:36:02 +0200 Subject: [PATCH] fix url rewrite - redirect frontend urls to react router --- docker/php/.htaccess | 12 ++++++++++++ php.dockerfile | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker/php/.htaccess diff --git a/docker/php/.htaccess b/docker/php/.htaccess new file mode 100644 index 0000000..1154d7f --- /dev/null +++ b/docker/php/.htaccess @@ -0,0 +1,12 @@ + + + Options -MultiViews + + RewriteEngine On + # Redirect Trailing Slashes... + RewriteRule ^(.*)/$ /$1 [L,R=301] + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.html [L] + \ No newline at end of file diff --git a/php.dockerfile b/php.dockerfile index 38a9ccc..f854fc8 100644 --- a/php.dockerfile +++ b/php.dockerfile @@ -28,4 +28,6 @@ RUN cp -r api-wiaas /var/www/html/ WORKDIR /home/wiaas/client-wiaas RUN npm rebuild node-sass --force RUN npm install && npm run build -RUN cp -r build/* /var/www/html/ \ No newline at end of file +RUN cp -r build/* /var/www/html/ + +COPY docker/php/.htaccess /var/www/html/ \ No newline at end of file