D
D
DenisVladimirovich2019-07-11 15:18:19
Node.js
DenisVladimirovich, 2019-07-11 15:18:19

How to publish react application?

Good day. There was a question about publishing a React application. Have your own server. The problem is that many servers, such as Apache or Express, cannot process the mysite.ru/blablabla path correctly for React. Tell me how you can run the application so that there are no such problems.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Night2013, 2019-07-11
@DenisVladimirovich

It is possible on any host for the site.
Move build to your site
In .htaccess write
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
AddDefaultCharset utf-8

G
giorgioromanni, 2020-01-31
@giorgioromanni

Isn't it easier to create a symbolic link to a folder?
For example:
ln -s build/ public_html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question