Host react application on Apache server

Adechinan Salami
1 min readMay 23, 2017

--

Step 1 : Create your app

npm install -g create-react-app 
create-react-app my-app

Step 2 : Build it for production

cd my-app
npm run build

Step 3 : deploy

  • copy and paste everything in build folder to your server
  • create a “.htaccess” file and add this snippet :
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

That’s all ! Enjoy it!

--

--