Clear separation of presentation and code-behind, declarative use of visual control elements and a supportive background framework to automate recurring tasks are fundamental to rapid web application development. In this paper, a framework is presented that facilitates extending Prolog applications with a web front-end. The framework relies on Prolog to the greatest possible extent, supports code re-use, and integrates easily into existing web server solutions. An architecture comprising two layers is elaborated. The lower layer, attached directly yet flexibly via FastCGI to the web server, handles issues of threading, basic session and context management, while the upper layer produces output based on XML source documents, which can be thought of as the Prolog counterparts of ASP.NET and Java server pages. The framework has been developed with SWI-Prolog and contains low-level c! ommunication code in C.