REDIRECT

Section: User Contributed Perl Documentation (1)
Updated: 2019-05-04
Index Return to Main Contents
 

NAME

.redirect - List of HTTP redirects parsed by authd-htpasswd  

DESCRIPTION

The .redirect files are text files that looked up by authd-htpasswd daemon to ask the web server to send HTTP 302 redirects. Each non-empty line has format: pattern target [condition [condition [...]]]
pattern
Regex pattern matching to current URL.

Supported variables are being substituted:

$wwp
Working Web Path. Eg. WWP of request to ``/static/js/site.js'' is ``/static/js''.
target
Target URL webserver have to redirect to. If target does not contain ? char, URL GET parameters are being appended to it. Supported variables are being substituted:
$scheme, ${scheme}
$host, ${host}
$method, ${method}
$args, ${args}
$uri, ${uri}
$root, ${root}
$remote_addr, ${remote_addr}
$n, ${n}
The nth regex group
conditions
You can combine more conditions just typing whitespace between them. They are evaluated conjunctively (AND-ite). The expr-n expressions are substituted like target. Currently supported conditions:
ifeq expr-1 expr-2
ifne expr-1 expr-2
 

Examples

^/index.html$ /

^(.*)$ https://$host$1 ifne $scheme https


 

Index

NAME
DESCRIPTION
Examples

This document was created by