Modrewrite到lighttpdModrewrite、lighttpd

2023-09-02 20:34:36 作者:The madman(疯子)

我有以下的.htaccess:

I've the following .htaccess:

RewriteEngine On
RewriteRule ^([^/]*).html /$1.php
RewriteRule ^scss/([^/]*).css$ /showcss.php?css=$1 [L]

我怎么能转换到lighttpd?

how can I convert it to lighttpd?

推荐答案

查看lighttpd的教程迁移来自Apache 。没有重写规则,从阿帕奇到lighttpd一个不错的1对1的映射,但这些应该是pretty的简单。看看这对你的作品(可能需要少量的正则表达式的调整):

See the lighttpd tutorial for Migrating from Apache. There isn't a nice 1-to-1 mapping of rewrite rules from apache to lighttpd, but those should be pretty straightforward. See if this works for you (may require a little regex tweaking):

url.rewrite-once = ( "^/([^/]*).html" => "/$1.php", 
                     "^/scss/([^/]*).css$" => "/showcss.php?css=$1")
 
精彩推荐