Project

General

Profile

Converting .htaccess to lighttpd.conf

Added by javier over 11 years ago

Hi
I've been reading the forums and many websites about how to convert form .htaccess to lighttpd.

I've have a CGI program running on Apache on Windows and I am migrating it to Lighttpd.
The version of Lighttpd is

LightTPD/1.4.32-1-IPv6 (Win32) - with SSL Support
A fast, secure and flexible webserver...
This version is built by WLMP Project, http://en.wlmp-project.net/
The package is compiled with GCC v4.5.3 under 'i686-pc-cygwin' platform.
Build-Date: Mar 1 2013 02:12:28

Here is my .htaccess file

RewriteEngine on
RewriteBase /
RewriteRule ^$ app.exe [L]
RewriteCond !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !app.exe
RewriteRule ^(.*)$ app.exe/$1
RewriteRule .* - [E=HTTP_AUTHORIZATION:
{HTTP:Authorization},L]

And this is what I generated based on the documentation

url.rewrite-once += (
"^.*\.(ico|exe)" => "$0",
"^/(.*)$" => "app.exe/$1"
)

and this is my CGI + document root configuration

document-root ="/htdocs"

cgi.assign = ( ".exe" => "C:/tmp/projects/app.exe" )

But when I ran it I got the following answer

htdocs/app.exe/api/message/time/now HTTP/1.1 404 Not Found

Thanks
Javier


Replies (4)

RE: Converting .htaccess to lighttpd.conf - Added by spaam over 11 years ago

did you load mod_rewrite ?

RE: Converting .htaccess to lighttpd.conf - Added by javier over 11 years ago

Yes I did. below the list of modules I'm loading

server.modules = (
"mod_access",
"mod_accesslog",
"mod_alias",
"mod_auth",
"mod_cgi",
"mod_proxy",
"mod_redirect",
"mod_rewrite",
)

RE: Converting .htaccess to lighttpd.conf - Added by nitrox over 11 years ago

"^.*\.(ico|exe)" => "$0" <= doesn´t this rewrite the app.exe too (rewrite to itself)?

RE: Converting .htaccess to lighttpd.conf - Added by javier over 11 years ago

Yes I've updated it.

"^.*\.(ico)" => "$0"

But still doesn't work.

    (1-4/4)