Using URL Rewrite
Installing SiteCake using this approach is based on the usage of the URL rewrite mechanism of the web server and does not requires any changes to the page templates. However it requires setting a set of rewrite rules in order to get the wanted behaviour.
The url rewrite engine is used in a such a way that every HTTP page request
(e.g. http://example.com/contact.html) is redirected to the SiteCake entry script (sitecake_entry.php) with the original URI (in this example ‘/contact.html’) passed as the url GET parameter (sitecake_entry.php?url=/contact.html’).
SiteCake engine uses the url GET paramter’s value as a relative path (from the site’s document root) to locate and load the respective page template.
The following is an example of the url rewrite configuration (e.g. in .htaccess for Apache).
# switch on the URL rewrite engine
RewriteEngine on
# set the correct rewrite base
RewriteBase /
# redirect every request that targets an HTML page (a request ending with '.html' or '.htm')
# to sitecake_entry.php, providing the original URI as the 'url' parameter value (e.g. url=/about.html)
# avoiding HTML files from the '/sitecake' folder
RewriteCond %{REQUEST_URI} ^.*\.html?$
RewriteCond %{REQUEST_URI} !^/sitecake/.*$
RewriteRule ^(.*)$ sitecake/server/sitecake_entry.php?url=$1 [QSA,L]
# this rewrite rule handles an empty URI (e.g. http://example.com/)
# a case when the index page has to be referenced
RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^(.*)$ sitecake/server/sitecake_entry.php?url=index.html [QSA,L]