Deploy React web application to shared hosting

Deploy React web application to shared hosting

react on shared hosting

Quick Start

npx create-react-app my-app
cd my-app
npm start
If you’ve previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.

(npx comes with npm 5.2+ and higher)

Then open to see your app.

For more details:

.htaccess file
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

26 thoughts on “Deploy React web application to shared hosting

  1. This video was really helpful!!!

    Perhaps It's just that i don't see it but <Layout> is wrapping all components and we don't see what's inside that specific component? I replaced it with BrowserRouter (after also replacing react-router with react-router-dom). Would be awesome if you could point out if im doing something fatally wrong xD


  2. Спасибо тебе)) добрый человек! Я вот вроде как всё также делал ток в package.json "homepage" не прописывал, а может просто на локальной машине не стоило пробовать, сразу на хостинг нужно было залить, не понятно мне. Но сделал всё как у тебя и всё ОК !

  3. I had deployed Reactjs application build to Control Panel. Home page is working fine but when I'm Clicking on about or others page showing error 404. But when I run application with npm start it is working properly. Could please help out .

Leave a Reply

Your email address will not be published. Required fields are marked *