Project

General

Profile

[Solved] Help to convert Apache .htaccess to Lighttpd

Added by john123 over 8 years ago

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
RewriteRule (^|/)\. - [F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sitemap.xml(\?.+)?$ cart.php?target=sitemap [NC,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((([/_a-z0-9-]+)/)?([_a-z0-9-]+)/)?([_a-z0-9-]+)(/?)(\.([_a-z0-9-]+))?$ cart.php?url=$5&last=$4&rest=$3&ext=$7 [NC,L,QSA]

</IfModule>

h2. Do you have an online converter from apache to lighttpd? Please advice.

Thank you.


Replies (1)

RE: [Solved] Help to convert Apache .htaccess to Lighttpd - Added by gstrauss about 7 years ago

For forbidding access to URLs, see Docs_ModAccess
For !-f and !-d See url.rewrite-if-not-file in Docs_ModRewrite
For QSA, match the query string using a lighttpd condition block and then substitute with %1, e.g.

$HTTP["querystring"] =~ "(.*)" {
  url.rewrite-if-not-file = ( "..." => "...&%1" )
} else {
  url.rewrite-if-not-file = ( "..." => "..." )
}

    (1-1/1)