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
RewriteRule "([^/]+)\.(js)" "resources/scripts/$1.$2" [L,qsappend]
RewriteRule "([^/]+)\.(css)" "resources/styles/$1.$2" [L,qsappend]
RewriteRule "([^/]+)\.(svg|png|gif)" "resources/images/$1.$2" [L,qsappend]
RewriteRule "home.html" "paloose-ini.php?url=index.html" [L,qsappend]
RewriteRule "^(.+)\.(html|xml|rng|px|xsl|kont)" "paloose-ini.php?url=$1.$2" [L,qsappend]
Copyright 2006 – 2024 Hugh Field-Richards. All Rights Reserved.