How to deploy the build on Apache WAMP/XAMPP server?
I have an app created with create-react-app and I have two pages on this applicati
Create a folder in htdocs (xampp) named react.
add "homepage": "./", (for relative path) or "homepage": "http://localhost/react/", (absolute path) in package.json file.
And on App.js file
Hello
"404 Not found!"} />
After configuring package.json and App.js run build command
npm run build
Then copy all files from build folder to react folder in htdocs.
And also create an .htaccess in react folder in htdocs.
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
If your sub folder name is different then replace /react with your folder name.
Example - rename /react from
"homepage": "http://localhost/react/"
to
"homepage": "http://localhost/your_folder_name/"