]> git.proxmox.com Git - pve-manager.git/blame - lib/PVE.old/URLRewrite.pm
imported from svn 'pve-manager/pve2'
[pve-manager.git] / lib / PVE.old / URLRewrite.pm
CommitLineData
aff192e6
DM
1package PVE::URLRewrite;
2
3use strict;
4use Apache2::Const qw(DECLINED);
5use PVE::HTMLUtils;
6
7sub handler {
8 my $r = shift;
9
10 my $uri = $r->uri;
11
12 if ($uri =~ m!^/(qemu|openvz)/(\d+)-(\d+)/(.*)$!) {
13 my $vmtype = $1;
14 my $newuri = "/$1/$4";
15 my $cid = $2;
16 my $veid = $3;
17
18 $r->uri ("$newuri");
19
20 $r->pnotes ("PVE_VMINFO", { cid => $cid, veid => $veid,
21 vmtype => $vmtype, uri => $uri});
22 }
23
24 return DECLINED;
25}
26
271;