@@ -40,6 +40,7 @@ and [old][Old Architecture] RN architectures.
40
40
[ getDeviceType() ] : https://www.npmjs.com/package/react-native-device-info#getDeviceType
41
41
[ MainBundlePath ] : https://www.npmjs.com/package/@dr.pogodin/react-native-fs#mainbundlepath
42
42
[ mod_alias ] : https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_alias
43
+ [ mod_rewrite ] : https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite
43
44
[ mod_webdav ] : https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav
44
45
[ react-native-device-info ] : https://www.npmjs.com/package/react-native-device-info
45
46
[ react-native-fs ] : https://www.npmjs.com/package/react-native-fs
@@ -52,6 +53,7 @@ and [old][Old Architecture] RN architectures.
52
53
- [ Getting Started] ( #getting-started )
53
54
- [ Bundling-in Server Assets Into an App Statically] ( #bundling-in-server-assets-into-an-app-statically )
54
55
- [ Enabling Alias module]
56
+ - [ Enabling Rewrite module]
55
57
- [ Enabling WebDAV module]
56
58
- [ API Reference] ( #api-reference )
57
59
- [ Project History and Roadmap] ( #project-history-and-roadmap )
@@ -360,10 +362,29 @@ root for a given url-subset. To enable it just use `extraConfig` option of
360
362
[Server] [constructor()] to load and configure it, for example:
361
363
362
364
` ` ` ts
363
- extraConfig: `
364
- server.modules += (" mod_alias" )
365
- alias.url = (" /sample/url" => " /special/root/path" )
366
- ` ,
365
+ extraConfig: `
366
+ server.modules += (" mod_alias" )
367
+ alias.url = (" /sample/url" => " /special/root/path" )
368
+ ` ,
369
+ ` ` `
370
+
371
+ # ## Enabling Rewrite Module
372
+ [Enabling Rewrite module]: # enabling-rewrite-module
373
+
374
+ [Lighttpd]'s module [mod_rewrite] can be used for interal redirects,
375
+ URL rewrites by the server. To enable it just use ` extraConfig` option of
376
+ [Server] [constructor()] to load and configure it, for example:
377
+
378
+ ` ` ` ts
379
+ extraConfig: `
380
+ server.modules += (" mod_rewrite" )
381
+ url.rewrite-once = (" /some/path/(.*)" => " /$1 " )
382
+ ` ,
383
+
384
+ // With such configuration, for example, a request
385
+ // GET " /some/path/file"
386
+ // will be redirected to
387
+ // GET " /file"
367
388
` ` `
368
389
369
390
# ## Enabling WebDAV Module
0 commit comments