From 7891de98b8214dadbfd98bb1c542fa10780b275e Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 2 Jun 2016 19:05:30 +0100 Subject: [PATCH] Add function --- src/htconvert.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/htconvert.js diff --git a/src/htconvert.js b/src/htconvert.js new file mode 100644 index 0000000..35d9a12 --- /dev/null +++ b/src/htconvert.js @@ -0,0 +1,7 @@ +const redirectRegex = /(?:Redirect\s*(\d*)\s*)(\S*)(?:\s*)(\S*)/g; +const nginxPattern = +`location $2 { + return $1 $3; +}`; + +export default htaccessRules => htaccessRules.replace(redirectRegex, nginxPattern);