Rewrite rules
From PlainOldWebserver
pow_server.REWRITE_RULES
This array of arrays contains all rules for rewriting incoming paths. They are written as Perl compatible regular expressions. To load these rules, place them in your htdocs/system/startup.sjs file
// htdocs/system/startup.sjs
<?sjs
pow_server.REWRITE_RULES =
[
[ "dog/?(.*)$", "/cat.sjs?q=$1" ],
[ /^\/Jason\/?(.*)$/i, "/cat.sjs?q=$1" ]
];
?>
Result:
"dog.html" becomes "/cat.sjs?q=.html" "/jaSOn/argonauts becomes "/cat.sjs?q=argonauts"
See Also
- pow_server.log_access()
- pow_server.get_uploaded_file()
- Server Variable list
- pow_server.REWRITE_RULES
