Project

General

Profile

[Solved] .htaccess to lighttpd url rewrite

Added by Luke about 10 years ago

Hello!

Lighttpd newbie here, was wondering if anyone could rewrite this so it is compatible with my lighttpd rewrite rules

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I need this .htaccess (httpd) to work with lighttpd rules!

Thanks!


Replies (2)

RE: .htaccess to lighttpd url rewrite - Added by szogunek almost 10 years ago

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

means

$HTTP["host"] =~ "^www\.(.*)" {
url.redirect = ( "^/(.*)" => "http://%1/$1" )
}

and

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

means

url.rewrite-once = (
"^/(.+)$" => "/index.php?url=$1"
)

should work

    (1-2/2)