Created
August 7, 2014 16:56
-
-
Save allardhoeve/8b5ff5ee628033ca5885 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Byte:::Apache2::RewriteURI; | |
use strict; | |
use warnings; | |
use Apache2::RequestRec (); | |
use Apache2::Const -compile => qw(DECLINED); | |
sub handler { | |
my $r = shift; | |
my $uri = $r->uri; | |
my ($domain) = $uri =~ m!/protected/([^/]+\.[^/]+)/!/protected/domein/!; # replace domain name by `domein` to be compat. | |
if ($domain) { | |
$r->pnotes("BYTE_URL_DOMAIN", $domain); # save the matched domain for use in Byte::AuthCookieHandler2::custom_errors | |
$r->uri($uri); | |
} | |
return Apache2::Const::DECLINED; # make sure other handlers (mod_rewrite) get their turn | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment