Configuring .htaccess File for Paloose Server

As was said above there is no need to change the name of the configuration file that sits in the user's site, and which starts Paloose running for each request. However if you do then the .htaccess file must be changed to reflect this. For example:

RewriteEngine On RewriteRule (.+)\.html paloose-ini.php?url=$1.html [L,qsappend]

If you want the configuration file to be called, say, mySite.php, then the .htaccess file must be changed to:

RewriteEngine On RewriteRule (.+)\.html mySite.php?url=$1.html [L,qsappend]

Adding file types to the .htaccess file

If you want to process requests other than an html type, then these have to be added to the .htaccess file. If you do not then the Apache server (or local equivalent) will process them instead. Say, for example, that we wanted Paloose to deal with RELAX NG files, then we would add the following line:

RewriteEngine On RewriteRule (.+)\.html mySite.php?url=$1.html [L,qsappend] RewriteRule (.+)\.rng mySite.php?url=$1.rng [L,qsappend]

As an example of a real file the following is the one from the system where Paloose and the web site are developed and tested.

RewriteEngine On # Should be first (processes raw files such as displayed CSS) RewriteRule /raw/(.+) paloose-ini.php?url=raw/$1 [L,qsappend] RewriteRule /pretty/(.+)\.rng paloose-ini.php?url=pretty/$1.rng [L,qsappend] RewriteRule (.+)\.html paloose-ini.php?url=$1.html [L,qsappend] RewriteRule (.+)\.htm paloose-ini.php?url=$1.htm [L,qsappend] RewriteRule (.+)\.rss paloose-ini.php?url=$1.rss [L,qsappend] RewriteRule (.+)\.px paloose-ini.php?url=$1.px [L,qsappend] RewriteRule (.+)\.kont paloose-ini.php?url=$1.kont [L,qsappend] RewriteRule mail paloose-ini.php?url=mail [L,qsappend] # Defines where all images should be taken from. This could go as an Alias in the # main conf file but this keeps it local to the site directory. RewriteRule examples/.+/(.+)\.png resources/images/$1.png [L,qsappend] RewriteRule examples/.+/(.+)\.gif resources/images/$1.gif [L,qsappend]
Copyright 2006 – 2017 Hugh Field-Richards. All Rights Reserved.