Skip to content

Commit

Permalink
Merge pull request #21 from unic/feature/handle-query-strings
Browse files Browse the repository at this point in the history
Feature/handle query strings
  • Loading branch information
kwiatekmon authored Mar 22, 2022
2 parents 6f82783 + 41c5494 commit d280e3e
Show file tree
Hide file tree
Showing 41 changed files with 296 additions and 166 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The csv format looks as follows: `Type;Name;Site;TargetSite;Permanent;Regex;Prot
|Term|Defines the term that should be matched|
|Target|Defines the target of the redirect. This can be either an external URL (eg. `https://google.com`), or the path to an item. Please note that the path shall not include any language code or site name (if you are using virtual paths). Example: `/products/super-product`|
|Description|An optional description of the redirect. This will be fed into the `Description` field on the created redirect item|
|PreserveQueryString|Set to `x` to handle and pass along query string from the requested URL|

A set of example csv records can be found here: `be\etc\import\example-import-file.csv`

Expand Down
27 changes: 14 additions & 13 deletions be/etc/import/example-import-file.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
Type;Name;Site;TargetSite;Permanent;Regex;Protocol;LanguageCode;Term;Target;Description
Type;Name;Site;TargetSite;Permanent;Regex;Protocol;LanguageCode;Term;Target;Description;PreserveQueryString

global;global redirect 1;;;;;any;en;global-redirect-one-en;https://www.google.com/?q=global-redirect-one-en;
global;global redirect 1;;;;;any;de-ch;global-redirect-one-de;https://www.google.com/?q=global-redirect-one-de;
global;global redirect 1;;;;;any;en;global-redirect-one-en;https://www.google.com/?q=global-redirect-one-en;;
global;global redirect 1;;;;;any;de-ch;global-redirect-one-de;https://www.google.com/?q=global-redirect-one-de;;

global;regex to internal;integration-site;integration-site;;x;any;en;^regex-to-internal-item;/sample item en/sub sample item en;
global;regex to internal;integration-site;integration-site;;x;any;de-ch;^regex-to-internal-item;/sample item de/sub sample item de;
global;regex to internal;integration-site;integration-site;;x;any;en;^regex-to-internal-item;/sample item en/sub sample item en;;
global;regex to internal;integration-site;integration-site;;x;any;de-ch;^regex-to-internal-item;/sample item de/sub sample item de;;

site;local redirect 1;integration-site;integration-site;;;any;en;local-redirect-one-en;https://www.google.com/?q=local-redirect-one-en;
site;local redirect 1;integration-site;integration-site;;;any;de-ch;local-redirect-one-de;https://www.google.com/?q=local-redirect-one-de;
site;local redirect 1;integration-site;integration-site;;;any;en;local-redirect-one-en;https://www.google.com/?q=local-redirect-one-en;;
site;local redirect 1;integration-site;integration-site;;;any;de-ch;local-redirect-one-de;https://www.google.com/?q=local-redirect-one-de;;

site;local redirect 2;urlmapper-jss-app;;;;any;en;local-redirect-two-en;https://www.google.com/?q=local-redirect-two-en;
site;local redirect 2;urlmapper-jss-app;;;;any;de-ch;local-redirect-two-de;https://www.google.com/?q=local-redirect-two-de;
site;local redirect 2;urlmapper-jss-app;;;;any;en;local-redirect-two-en;https://www.google.com/?q=local-redirect-two-en;;
site;local redirect 2;urlmapper-jss-app;;;;any;de-ch;local-redirect-two-de;https://www.google.com/?q=local-redirect-two-de;;

site;local redirect 3;urlmapper-jss-app;urlmapper-jss-app;;;any;en;local-redirect-three-en;/graphql/sample-1;
site;local redirect 3;urlmapper-jss-app;urlmapper-jss-app;;;any;de-ch;local-redirect-three-de;/graphql/sample-2;
site;local redirect 3;urlmapper-jss-app;urlmapper-jss-app;;;any;en;local-redirect-three-en;/graphql/sample-1;;
site;local redirect 3;urlmapper-jss-app;urlmapper-jss-app;;;any;de-ch;local-redirect-three-de;/graphql/sample-2;;

site;local redirect to different site 1;integration-site;urlmapper-jss-app;;;any;de-ch;local-redirect-to-different-site-one-de;/graphql/sample-1;
site;local redirect 4;urlmapper-jss-app;urlmapper-jss-app;;x;any;en;local-redirect-four-en;/graphql/sample-1;;x
site;local redirect 4;urlmapper-jss-app;urlmapper-jss-app;;x;any;de-ch;local-redirect-four-de;/graphql/sample-2;;x

global;global capture 1;;;;x;any;en;^global-capture([?].*)?;https://www.google.com;Transfers all query strings to the target url;
global;global capture 1;;;;x;any;en;^global-capture([?].*)?;https://www.google.com;Transfers all query strings to the target url;;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DB: master
SharedFields:
- ID: "814bdd80-36de-46fa-938c-46ceaf5d9722"
Hint: Last Import Date
Value: 20200319T090444
Value: 20220303T122127
Languages:
- Language: "de-CH"
Versions:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "f574ec6f-90d7-4fa4-aedf-90aa70122162"
ID: "21f324aa-3c36-4072-863a-7226e32b0d9d"
Parent: "c4cb89d8-fb85-4c3f-8cb4-690d3cde7314"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Redirects/Imported Redirects/2020
Path: /sitecore/content/Redirects/Imported Redirects/2022
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112126Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "cccfbe6d-3527-427f-add7-4030518356af"
Parent: "f574ec6f-90d7-4fa4-aedf-90aa70122162"
ID: "4add7098-2a59-4601-b5fe-eb24f49bed9d"
Parent: "21f324aa-3c36-4072-863a-7226e32b0d9d"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03
Path: /sitecore/content/Redirects/Imported Redirects/2022/03
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112126Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "b20ecc4a-7632-4d99-baf9-b402c34c3f23"
Parent: "cccfbe6d-3527-427f-add7-4030518356af"
ID: "f857132e-b7f4-4566-9e05-28586145125a"
Parent: "4add7098-2a59-4601-b5fe-eb24f49bed9d"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03/19
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112126Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "21cbc4bc-aafb-4993-86a8-e6367a9cc469"
Parent: "b20ecc4a-7632-4d99-baf9-b402c34c3f23"
ID: "f63b3b2d-6991-4c58-950f-ed8560b6fdbe"
Parent: "f857132e-b7f4-4566-9e05-28586145125a"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03/19/08
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03/11
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112126Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
ID: "d5005fbe-c04c-4442-8dfe-154a87816d7f"
Parent: "f63b3b2d-6991-4c58-950f-ed8560b6fdbe"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03/11/21
DB: master
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20220303T112126Z
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
---
ID: "5c241ecc-bf5e-4c3a-8a87-b1353c0b7d1b"
Parent: "b46a62af-9d76-4a27-a3da-46a6b04eaf46"
ID: "aba08c80-14f1-4623-90e4-c2ad574c6559"
Parent: "d5005fbe-c04c-4442-8dfe-154a87816d7f"
Template: "91b6672e-51a2-48db-9a17-d9e8744ee490"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03/19/08/04/global capture 1
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03/11/21/global capture 1
DB: master
SharedFields:
- ID: "a21daddf-e5b1-4134-b236-9515d9153ef6"
Hint: Regex enabled
Type: Checkbox
Value: 1
- ID: "a9d3d444-c009-4c90-b1a2-f8c25d28d084"
Hint: Preserve Query String
Type: Checkbox
Value: 0
Languages:
- Language: en
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080444Z
Value: 20220303T112127Z
- ID: "51a833be-0259-46cb-ac5f-7fc9fbacd6ef"
Hint: Description
Value: Transfers all query strings to the target url
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
---
ID: "b0cb4bd5-eda8-4ea3-a784-bd9c39c1ce5e"
Parent: "b46a62af-9d76-4a27-a3da-46a6b04eaf46"
ID: "107ec85d-d439-430d-8ffe-474c7439c1f7"
Parent: "d5005fbe-c04c-4442-8dfe-154a87816d7f"
Template: "91b6672e-51a2-48db-9a17-d9e8744ee490"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03/19/08/04/global redirect 1
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03/11/21/global redirect 1
DB: master
SharedFields:
- ID: "a21daddf-e5b1-4134-b236-9515d9153ef6"
Hint: Regex enabled
Type: Checkbox
Value: 0
- ID: "a9d3d444-c009-4c90-b1a2-f8c25d28d084"
Hint: Preserve Query String
Type: Checkbox
Value: 0
Languages:
- Language: "de-CH"
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
Expand All @@ -34,7 +38,7 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
---
ID: "0bcee8cd-dd64-491e-8ef1-67a7e20e5770"
Parent: "b46a62af-9d76-4a27-a3da-46a6b04eaf46"
ID: "dd0cb766-5a2f-4683-bd88-6e600eeb5bd5"
Parent: "d5005fbe-c04c-4442-8dfe-154a87816d7f"
Template: "91b6672e-51a2-48db-9a17-d9e8744ee490"
Path: /sitecore/content/Redirects/Imported Redirects/2020/03/19/08/04/regex to internal
Path: /sitecore/content/Redirects/Imported Redirects/2022/03/03/11/21/regex to internal
DB: master
SharedFields:
- ID: "a21daddf-e5b1-4134-b236-9515d9153ef6"
Hint: Regex enabled
Type: Checkbox
Value: 1
- ID: "a9d3d444-c009-4c90-b1a2-f8c25d28d084"
Hint: Preserve Query String
Type: Checkbox
Value: 0
Languages:
- Language: "de-CH"
Versions:
- Version: 1
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
Expand All @@ -34,7 +38,7 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
- ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
Hint: __Created by
Value: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DB: master
SharedFields:
- ID: "814bdd80-36de-46fa-938c-46ceaf5d9722"
Hint: Last Import Date
Value: 20200319T090444
Value: 20220303T122128
- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc"
Hint: __Originator
Value: "{42D6C936-BD8A-4A06-996B-14AE84345706}"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "7b28d81f-617b-473d-89c8-be70be210a38"
ID: "5b1443d6-97cd-4e7b-b2d7-781b48161f06"
Parent: "5c604662-608f-4f3b-a6f9-6323b8b6533a"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2020
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2022
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "ff525289-c331-4212-bdc3-74b09961ee0b"
Parent: "7b28d81f-617b-473d-89c8-be70be210a38"
ID: "d084a9a5-50bf-4ac5-9c70-eb3174cf6ad0"
Parent: "5b1443d6-97cd-4e7b-b2d7-781b48161f06"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2020/03
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2022/03
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "c6a3e4c1-090f-4275-a6ea-d30dfc2166a8"
Parent: "ff525289-c331-4212-bdc3-74b09961ee0b"
ID: "878d9eea-544b-41f1-afa1-920ee3888a59"
Parent: "d084a9a5-50bf-4ac5-9c70-eb3174cf6ad0"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2020/03/19
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2022/03/03
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
ID: "d5e9408f-2304-41f8-875c-e7993e91be2f"
Parent: "c6a3e4c1-090f-4275-a6ea-d30dfc2166a8"
ID: "21aec2db-cf0c-44d6-abc9-a9785d213235"
Parent: "878d9eea-544b-41f1-afa1-920ee3888a59"
Template: "adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97"
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2020/03/19/08
Path: /sitecore/content/Integration Site/Redirects/Imported Redirects/2022/03/03/11
DB: master
Languages:
- Language: en
Expand All @@ -11,4 +11,4 @@ Languages:
Fields:
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
Hint: __Created
Value: 20200319T080443Z
Value: 20220303T112127Z
Loading

0 comments on commit d280e3e

Please sign in to comment.