# redirection/2.2.2/actions/url.php

Redirection, version 2.2.2. 21 lines.

- Page: https://pluginprobe.com/plugins/redirection/2.2.2/code/actions/url.php
- Raw: https://pluginprobe.com/plugins/redirection/2.2.2/raw/actions/url.php
- Modified: 2010-11-21T14:04:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/redirection/2.2.2/code/actions/url.php#L10-L20`.

```php
<?php

class Url_Action extends Red_Action {
	function can_change_code() {
		return true;
	}
	
	function action_codes()	{
		return array(
			301 => get_status_header_desc( 301 ),
			302 => get_status_header_desc( 302 ),
			307 => get_status_header_desc( 307 )
		);
	}
	
	function process_before( $code, $target ) {
		wp_redirect( $target, $code );
		die();
	}
}

```
