Skip to content

Commit 443ca23

Browse files
viankakrisnagaearon
authored andcommitted
Add docs for apache's client side routing setting (#1717)
* Add docs for apache's client side routing setting * Tweak advice
1 parent 8951fbe commit 443ca23

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/react-scripts/template/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,17 @@ This is because when there is a fresh page load for a `/todos/42`, the server lo
12501250
});
12511251
```
12521252

1253+
If you’re using [Apache](https://httpd.apache.org/), you need to create a `.htaccess` file in the `public` folder that looks like this:
1254+
1255+
```
1256+
Options -MultiViews
1257+
RewriteEngine On
1258+
RewriteCond %{REQUEST_FILENAME} !-f
1259+
RewriteRule ^ index.html [QSA,L]
1260+
```
1261+
1262+
It will get copied to the `build` folder when you run `npm run build`.
1263+
12531264
Now requests to `/todos/42` will be handled correctly both in development and in production.
12541265

12551266
### Building for Relative Paths

0 commit comments

Comments
 (0)