NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on July 08, 2019, 04:09:46 AM
-
Hi
I think I've read about it somewhere in the documentation a long time ago. But I simply can't remember where?
Can anyone help?
Regards Niels
-
In WebHandler, ReadFile method, AFTER parent call.
Check the Return value there, and if it's 404 (page not found) then "rewrite" the p_FileName variable.
For example, I have a table "Quicklinks". So my code looks like this;
If returnValue = 404 ! page not found, so check quicklinks file to see if there's a match
Access:quickLinks.Open()
Access:quickLinks.UseFile()
Qui:Quick = sub(p_FileName,len(clip(self.site.WebFolderPath) & '\')+1,255)
If Access:QuickLinks.Fetch(Qui:QuickKey) = 0
Qui:full = clip(self.site.WebFolderPath) & '\' & Qui:Full
ReturnValue = PARENT.ReadFile(Qui:Full,p_Buffer,p_FileDate,p_FileTime,p_Parse,pShared)
end
Access:quickLinks.Close()
End
Cheers
Bruce
-
Thanks Bruce
I'll try it.
Am I wrong when I remember reading about it in the documentation - a long time ago?
-
probably - I don't remember documenting this, although I may have gone over it in training or a webinar or something.
cheers
Bruce
-
If returnValue = 404 ! page not found, so check quicklinks file to see if there's a match
Access:quickLinks.Open()
Access:quickLinks.UseFile()
Qui:Quick = sub(p_FileName,len(clip(self.site.WebFolderPath) & '\')+1,255)
If Access:QuickLinks.Fetch(Qui:QuickKey) = 0
Qui:full = clip(self.site.WebFolderPath) & '\' & Qui:Full
ReturnValue = PARENT.ReadFile(Qui:Full,p_Buffer,p_FileDate,p_FileTime,p_Parse,pShared)
end
Access:quickLinks.Close()
End
I dont understandt wht is it code for... please explain, thanks
-
It allows you to map a "friendly" URL to some "real" URL.
Cheers
Bruce