normalise the url given so that users redirecting to http://example.com don't have problems. Closes: #1079

This commit is contained in:
Antoine Beaupré 2007-11-15 19:21:31 +00:00
parent d6d765eba9
commit a478703bb4
1 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,10 @@ add_host() {
$TYPE_URL)
mkdir -p "$htaccess_directory"
# normalize the url provided to make sure the hostname part is
# followed by at least /
value=`echo $value | sed -e 's#\([^/:]*://\)\?\([^/]*\)/*\(.*\)#\1\2/\3#'`
(echo "RewriteEngine on"
echo "RewriteRule (.*) ${value}\$1 [R,L]"
) > "$htaccess_directory/.htaccess"