Project

General

Profile

LightTPD Rewrite Assistance

Added by cmanns over 15 years ago

Hello guys, I'm trying to migrate another site to my new LightTPD 1.5 server. The os is FreeBSD 7.1.

I got a site that hosts images and such, everything is piped through rewrite.php

This is the mod rewrite
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rewrite.php?rewrite-url=$1 [QSA,L]

I tried Darix's drupal.lua like I did for Invision Power Board's Minerva friendly url add on (Which seemed to work flawlessly) I forget what I edited. Now I'm not a coder I try to learn but I guess I lost what I edited on the drupal.lua or I didn't have to edit much.

This is the lighttpd rewrite I tried

"^/([^\?]+)(\?(.*))$" => "/rewrite.php?rewrite-url=$1"

The site has urls such as
domain.com/myfiles?folder_id=80
The above rewrite didn't like the ?'s and would just redirect back to the index. The drupal.lua worked for pretty much everything except the more advanced urls.

This would be a url to a image in a page http://filesend.it/view/999_g6mzh the larger image it's self if applys has it's own url, and so do the "direct" urls. Everything is piped through rewrite.php.

Any ideas on how I can get this to work :( I don't mind using the lua script but I don't know what it needs edited to work.

if you guys would like the rewrite.php code too just ask.

-Chris


Replies (1)

RE: LightTPD Rewrite Assistance - Added by cmanns over 15 years ago

Whoops I had the rewrite I tried wrong.

I dunno why I tried ""^/([^\?]+)(\?(.*))$" => "/rewrite.php?rewrite-url=$1" after that I was trying the lua script.

I used

"^/(.*)$" => "/rewrite.php?rewrite-url=$1"

    (1-1/1)