Apache.htaccess file on lighttpd

RewriteEngine on RewriteRule ^packed\.js$ pack.php?debug=0 [nc] RewriteRule ^debug$ pack.php?debug=1 [nc] 

This worked fine on apache in a .htaccess file located in a specific directory. If I want to do this on lighttpd, do I need to add it to the configuration file or something like that?

Do I need to make any changes to these rules?

+4
source share
1 answer

lighttpd does not support .htaccess files such as Apache httpd. That the "light" in "lighttpd" comes into play.

However, you can transfer these rules from Apache httpd mod_rewrite to lighttpd mod_rewrite . But keep in mind that the NC (case insensitive) flag is not supported by lighttpd mod_rewrite. If everything is fine with you, you can simply use the following rewrite rules:

 url.rewrite-once = ( "^packed\.js$" => "pack.php?debug=0", "^debug$" => "pack.php?debug=1" ) 

If you want the match to be case insensitive, you probably need to call mod_magnet and a custom Lua script.

+7
source

All Articles