Skip to content

Commit

Permalink
Merge pull request #1 from unic/feature/initial-version
Browse files Browse the repository at this point in the history
Feature/initial version
  • Loading branch information
schwindelig authored Mar 5, 2020
2 parents f30e7ff + 7d9fd88 commit bce1526
Show file tree
Hide file tree
Showing 673 changed files with 47,104 additions and 1 deletion.
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
# SitecoreUrlMapper2
# Sitecore URL Mapper 2

Sitecore URL Mapper 2 is a Sitecore Module allowing Authors to define redirects within Sitecore. This module is the successor to our [original Url Mapper Module](https://github.com/unic/SitecoreUrlMapper).

## Features

### Support for Plain Sitecore and JSS Headless

The module fully supports JSS in integrated and headless mode. Of course, native Sitecore setups are also supported.

In order to support redirects in JSS, you will have to patch the following processor within the `<mvc.requestBegin>` pipeline:

```xml
<processor patch:after="*[last()]" type="Unic.UrlMapper2.Pipelines.MvcRequestBegin.TryPerformRedirectJss, Unic.UrlMapper2" />
```

### Support for Multi-Site setups

Redirects can be defined on Site or a Global level, allowing you to target only specific sites or all sites within your setup.

### Wildcard and Regex matching

Redirects can be defined with Regex patterns, allowing you to be even more specific about what should and should not be redirected.

For example, if you would like to have a "wildcard" matching, you can define the term as `^mytest`, which will result in all of the following requests being a match: `https://mysite.com/test`, `https://mysite.com/testing`, `https://mysite.com/test-redirect`.

### Bulk Import

A Sitecore PowerShell script is included allowing Authors to upload a CSV containing redirect definitions.

The csv format looks as follows: `Type;Name;Site;TargetSite;Permanent;Regex;Protocol;LanguageCode;Term;Target;Description`

|Column|Description|
|---|---|
|Type|Defines on what level the redirect should be created. The value can be either `global` or `site`|
|Name|Item name of the redirect. This value will be used to determine what language versions belong to this item.|
|Site|Sitecore Site name, used if the redirect type is set to `site`. The redirect will then be created within that sites redirect folder|
|TargetSite|If you are creating cross-site links, or global links, this value determines in what site the item target item will be searched in. This value needs to be internal Sitecore site name|
|Permanent|Defines if the redirect should be created as a permanent redirect. Set to `x` to enable permanent redirect|
|Regex|Defines if the redirect should support regex patterns within the term field. Set to `x` to enable regex support|
|Protocol|Used to set the `Protocol` field on the item. Can be either `http`, `https` or `any`|
|LanguageCode|Determines the language version of the record to be created|
|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|

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

### Easy installation, prepared for Azure and Azure DevOps

The Module can be downloaded either from Github or the Sitecore Marketplace. The module is distributed as a standard Sitecore installation package and also as Sitecore Web Deploy package (scwdp), allowing it to be included into existing ARM templates or referenced through the out of the box Azure DevOps Web Deploy tasks.

### Support for SolR and Azure Search

URL Mapper is a ContentSearch driven module. It ships with pre-defined configurations and support for SolR and Azure Search.

### Extensibility

The module offers several extension points and the framework elements have been developed in a way that they can be easily overwritten and adapted for custom requirements.

## Pre-Requisites and limitations

- The Content Search Provider must be either SolR or Azure Search, Lucene is not supported.
- The module assumes that Sitecore PowerShell extensions are available.

## Development

If you would like to extend the Module and set up a local development environment, please follow the steps described [over here](/be/docs/README.md).
1 change: 1 addition & 0 deletions be/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=urlmapper2
15 changes: 15 additions & 0 deletions be/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.csproj text=auto merge=union
*.sln text=auto eol=crlf merge=union

## Sitecore specific settings ##
# unset the text attribute and prevent git from normalizing serialized files
*.item -text
*.role -text

# Always use LF for linux scripts
*.sh text eol=lf
Loading

0 comments on commit bce1526

Please sign in to comment.