Sha256: 4143a811eb82e5b5e4c3753dac947e4f3b307dfcd5cb340f5f194557e59059e9

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

<!DOCTYPE html>
<html>
	<head>
		
			<title>Redirection</title>
		
		<meta charset="UTF-8"/>
		
		<link rel="icon" type="image/png" href="../../_static/icon.png"/>
		<link rel="stylesheet" href="../../_static/site.css" type="text/css" media="screen"/>
		
		<script src="../../_components/jquery/jquery.min.js"></script>
		<script src="../../_components/jquery-syntax/jquery.syntax.min.js"></script>
		
		<script type="text/javascript">
		//<![CDATA[
			jQuery(function($) {
				$.syntax();
			});
		//]]>
		</script>
	</head>

	<body class="show">
		
	<nav> › <a href="../../index.html">Wiki</a> › <span>Middleware</span> › <a href="index.html">Redirection</a></nav>

	
	<main>
		<h1 id="redirection">Redirection</h1>

<p>A set of flexible URI rewriting middleware which includes support for string mappings, regular expressions and status codes (e.g. 404 errors).</p>

<pre><code class="language-ruby"># String (fast hash lookup) rewriting:
use Utopia::Redirection::Rewrite,
	'/' =&gt; '/welcome/index'

# Redirect directories (e.g. /) to an index file (e.g. /index):
use Utopia::Redirection::DirectoryIndex,
	index: 'index.html'

# Redirect (error) status codes to actual pages:
use Utopia::Redirection::Errors,
	404 =&gt; '/errors/file-not-found'
</code></pre>

	</main>
	
	<footer>
		Last Modified: 2020-04-28 11:35:36 +1200
		— middleware/redirection/index.md
	</footer>

	</body>
</html>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
utopia-2.15.1 docs/middleware/redirection/index.html
utopia-2.15.0 docs/middleware/redirection/index.html
utopia-2.14.0 docs/middleware/redirection/index.html