# UrlNormalizerRedirectException

> UrlNormalizerRedirectException represents an information for redirection which should be performed during the URL normalization.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [web](/docs/api/yii/web/index.md) › UrlNormalizerRedirectException

| class | `yii\web\UrlNormalizerRedirectException` |
| --- | --- |
| Extends | [`yii\base\Exception`](/docs/api/yii/base/exception/index.md) » [`Exception`](https://www.php.net/manual/en/class.exception.php) |
| Since | 2.0.10 |
| Source | [`framework/web/UrlNormalizerRedirectException.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/web/UrlNormalizerRedirectException.php#L18) |

UrlNormalizerRedirectException represents an information for redirection which should be
performed during the URL normalization.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-scheme"></span>`$scheme` | `bool\|string` | The URI scheme to use in the generated URL for redirection Default: `null`. | `UrlNormalizerRedirectException` |
| <span id="property-statusCode"></span>`$statusCode` | `int` | The HTTP status code Default: `null`. | `UrlNormalizerRedirectException` |
| <span id="property-url"></span>`$url` | `array\|string` | The parameter to be used to generate a valid URL for redirection Default: `null`. | `UrlNormalizerRedirectException` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) |  | `UrlNormalizerRedirectException` |
| <span id="method-getName"></span>[`getName()`](/docs/api/yii/base/exception/index.md#method-getName) |  | [`yii\base\Exception`](/docs/api/yii/base/exception/index.md) |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(array|string $url, int $statusCode = 302, bool|string $scheme = false, string|null $message = null, int $code = 0, Throwable|null $previous = null)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$url` | `array\|string` | The parameter to be used to generate a valid URL for redirection. This will be used as first parameter for [`Url::to()`](/docs/api/yii/helpers/baseurl/index.md#method-to) |
| `$statusCode` | `int` | HTTP status code used for redirection |
| `$scheme` | `bool\|string` | The URI scheme to use in the generated URL for redirection. This will be used as second parameter for [`Url::to()`](/docs/api/yii/helpers/baseurl/index.md#method-to) |
| `$message` | `string\|null` | The error message |
| `$code` | `int` | The error code |
| `$previous` | [`Throwable`](https://www.php.net/manual/en/class.throwable.php)`\|null` | The previous exception used for the exception chaining |