2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

01_FHEMWEB.pm: some help for fhemApp (Forum #119470)

git-svn-id: https://svn.fhem.de/fhem/trunk@23980 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-03-15 14:30:36 +00:00
parent 3b3c62ad6f
commit 861def5d87

View File

@ -195,6 +195,7 @@ FHEMWEB_Initialize($)
plotWeekStartDay:0,1,2,3,4,5,6 plotWeekStartDay:0,1,2,3,4,5,6
nrAxis nrAxis
redirectCmds:0,1 redirectCmds:0,1
redirectTo
refresh refresh
reverseLogs:0,1 reverseLogs:0,1
roomIcons:textField-long roomIcons:textField-long
@ -869,7 +870,8 @@ FW_answerCall($)
$dir =~ s,www/,,g; # Want commandref.html to work from file://... $dir =~ s,www/,,g; # Want commandref.html to work from file://...
my $file = urlDecode($ofile); # 69164 my $file = urlDecode($ofile); # 69164
$file =~ s/\?.*//; # Remove timestamp of CSS reloader $file =~ s/[?#].*//; # Remove timestamp of CSS reloader
$file = "index.html" if(defined($file) && $file eq ""); # 119470
if($file =~ m/^(.*)\.([^.]*)$/) { if($file =~ m/^(.*)\.([^.]*)$/) {
$file = $1; $ext = $2; $file = $1; $ext = $2;
} }
@ -891,6 +893,12 @@ FW_answerCall($)
return FW_serveSpecial("favicon", "ico", "$FW_icondir/default", 1); return FW_serveSpecial("favicon", "ico", "$FW_icondir/default", 1);
} else { } else {
my $redirectTo = AttrVal($FW_wname, "redirectTo","");
if($redirectTo) {
Log3 $FW_wname, 1, "$FW_wname: redirecting $arg to $FW_ME/$redirectTo$arg";
return FW_answerCall("$FW_ME/$redirectTo$arg")
}
Log3 $FW_wname, 4, "$FW_wname: redirecting $arg to $FW_ME"; Log3 $FW_wname, 4, "$FW_wname: redirecting $arg to $FW_ME";
TcpServer_WriteBlocking($me, TcpServer_WriteBlocking($me,
"HTTP/1.1 302 Found\r\n". "HTTP/1.1 302 Found\r\n".