-
Notifications
You must be signed in to change notification settings - Fork 166
Examples From Help File
buthub edited this page Sep 25, 2018
·
1 revision
-
Static redirect
Example URL: http://example.com/foo Include pattern: http://example.com/foo Redirect to: http://example.com/bar Pattern type: Wildcard Example result: http://example.com/bar -
Redirect using query string parameter and wildcards
Example URL: http://example.com/index.php?id=12345&a=b Include pattern: http://example.com/index.php?id=*&a=b Redirect to: http://example.com/printerfriendly.php?id=$1&a=b Pattern type: Wildcard Example result: http://example.com/printerfriendly.php?id=12345&a=b -
Redirect using query string parameter and regular expressions
Example URL: http://example.com/index.php?id=12345&a=b Include pattern: http://example.com/index.php\?id=(\d+)&a=b Redirect to: http://example.com/printerfriendly.php?id=$1&a=b Pattern type: Regular Expression Example result: http://example.com/printerfriendly.php?id=12345&a=b -
Redirect to a different folder using wildcards
The exclude pattern makes sure that there is only one folder there, so for instance http://example.com/category/fish/cat/mouse/index.php would not match.Example URL: http://example.com/category/fish/index.php Include pattern: http://example.com/category/*/index.php Exclude pattern: http://example.com/category/*/*/index.php Redirect to: http://example.com/category/cat/index.php Pattern type: Wildcard Example result: http://example.com/category/cat/index.php -
Redirect http to https using wildcards
Example URL: http://mail.google.com/randomcharacters Include pattern: http://mail.google.com* Redirect to: https://mail.google.com$1 Pattern type: Wildcard Example result: https://mail.google.com/randomcharacters