Project

General

Profile

Actions

Bug #308

closed

.htaccess rewrite rules

Added by Anonymous over 19 years ago. Updated over 15 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_rewrite
Target version:
-
ASK QUESTIONS IN Forums:

Description

I am in the final stage to transform my http://oslookup.org to lighttpd with mod_cml

I missing how to apply the following apache rewrite rules to lighttpd equivelants -)

#for www-to-non-www redirection:

RewriteCond %{HTTP_HOST} !^oslookup\.org 
RewriteRule (.*) http://oslookup.org/$1 [R=301,L]
# Rewrite URLs of the form 'index.php?q=x':
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} ^index.php$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Any help will be appreciated. Also a lighttpd donation will be released!

-- oslookup


Related issues 2 (0 open2 closed)

Has duplicate Bug #2109: implement .htaccess files to different directories and different usersInvalid2009-11-28Actions
Has duplicate Feature #2110: implement .htaccess files to different directories and different usersInvalid2009-11-29Actions
Actions #1

Updated by Anonymous over 19 years ago

These interesting pages may help us solve this quiz!

http://drupal.org/node/20766 (Drupal and lighttpd rewrite rules)

http://digitalhandyman.info/articles/2005/08/14/gallery-url-rewriting-in-lighttpd (Gallery and lighttpd rerwrite rules)

http://www.xyooj.com/blog/plink/category/technical/lighttpd/ (Multi domain with multi sub-domains)

We have the configuration pieces... We miss a clever guy to put all pieces together in the right position!
Sorry Jan, I am not a clever guy and you are too alone in this brilliant project :)

-- oslookup

Actions #2

Updated by Anonymous over 19 years ago

As far as I can tell, lighttpd still doesn't support flexible enough error-redirection (as in the 2nd part of oslookup's original post).

Suppose you have a CMS (blog, wiki, or such) that accepts clean URLs, but you also have some regular files whose locations, if requested directly by a web user, might be mistaken as clean URLs and rewritten by the CMS (actually the web server) to something like {{{/index.php?id=thefile}}}.

The web server ought to be able to say:

  1. If the file specified by the URL exists, serve it;
  2. If not (i.e. if a 404 would result), apply a set of rewrite rules, such as:
url.rewrite-once ( "^/(.*)$" => "/index.php?id=$1" )

One program which uses Apache rewrite rules to do this is DokuWiki.

Unless I'm missing something, lighttpd can't reproduce such rules.

-- anonymous2

Actions #3

Updated by jan over 19 years ago

  • Status changed from New to Assigned

There is no need to produce such rules.

server.error-handler-404 = "/index.php"

and parse REQUEST_URI in the application.

Actions #4

Updated by Anonymous over 19 years ago

That would require editing the application, right? If so, is there a reason to require applications to adapt to lighttpd, rather than lighttpd to adapt to applications which rely on certain Apache features (such as this one)? If lighttpd is to be a replacement for Apache, it seems to me it ought to have the same capabilities, even if it implements them differently.

Even if lighttpd is not to have the same capabilities as Apache, is there a reason to exclude this feature, or is it just a matter of time before it will be implemented?

-- anonymous2

Actions #5

Updated by Anonymous about 18 years ago

This whole ticket looks awfully like disguised spam!

-- anonymous475987

Actions #6

Updated by moo about 18 years ago

typo

Actions #7

Updated by darix about 18 years ago

  • Status changed from Assigned to Fixed
  • Resolution set to fixed

about comment #5:
just because apache provides solution to keep broken php code around for ages, we dont need do the same in lighttpd.

anyway ... maybe this code helps you:
http://pixel.global-banlist.de/2007/2/6/drupal-on-lighttpd-with-clean-urls

Actions #8

Updated by Anonymous about 18 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (fixed)

Will lighttp never support htaccess?

It's actually lot of work always to transform htaccess files to lighttpd confs and/or remind projects also provide lighttpd confs..

Actions #9

Updated by Anonymous over 17 years ago

Yes, I agree with a person who wrote comment #8. Lighttpd should accept .htaccess files. However, I do not order Lighttpd to understand Apache's syntax (which is different), but I would like to add some lighty's configuration in .htaccess files. I'm telling it in mod_rewrite's context as it's very comfortable to have a seperate file (.htaccess) with rewrite rules - versus edition of lighttpd.conf.

-- Nowaker

Actions #10

Updated by darix over 17 years ago

we will not support the apache syntax in core any time soon. that said even if we support .htaccess alike files you still have to convert the syntax.
the example from the original comment uses -f/-d conditionals. those require mod_magnet in lighttpd. (see http://pixel.global-banlist.de/tags/mod_magnet http://trac.lighttpd.net/trac/wiki/Docs:ModMagnet)

mod_magnet scripts are reloaded when they have changed. that said you just need to convert your rules to mod_magnet scripts and get the features already.

Actions #11

Updated by Anonymous over 17 years ago

lighthttpd looked like promising replaces for Apache to me. But when I found that .htaccess is not supported... Sorry, lighthttpd is no go. We have lots of sites with lots of .htaccess. And it is not a question to convert them manually.

May be, you guys, did a great job, I do not know. But your comments about .htaccess make me think that lighthttpd is just a hobby project for you ("we do only what we want to do, we do not care about business customers"). I doubt you can replace existing Apache installations with such attitude.

Anyway, good luck to your project.

Actions #12

Updated by Anonymous over 17 years ago

Replying to anonymous:

lighthttpd looked like promising replaces for Apache to me. But when I found that .htaccess is not supported... Sorry, lighthttpd is no go. We have lots of sites with lots of .htaccess. And it is not a question to convert them manually.

May be, you guys, did a great job, I do not know. But your comments about .htaccess make me think that lighthttpd is just a hobby project for you ("we do only what we want to do, we do not care about business customers"). I doubt you can replace existing Apache installations with such attitude.

Anyway, good luck to your project.

Your comments make me think that English is just a hobby language for you

Actions #13

Updated by Anonymous over 17 years ago

I tend to agree that it is a problem not to have something compatible with .htaccess.
Lots of php programs were written for Apache and use .htaccess to modify php behavior for just one site or directory.
After spending all night and more hours setting up lighttpd so it'll run php. I'm now stuck trying to figure out how to adapt .htaccess or make a fix, hack to replace it.
So how would someone convert the simple problem of making password protected directories without .htaccess using lighttpd?
Actually this question is not about rewrite rules but this forum popped up on google when I looked for .htaccess and lighttpd.

Actions #14

Updated by Anonymous over 17 years ago

I'll answer my own post since I posted this in the wrong place.
I now found out that I should have been looking at mod_auth for directory access stuff. Although I didn't get that to work either. Maybe I'll wait until next year and keep on using Apache instead of wasting my time trying to reinvent the wheel just so lighttpd will work the way it's supposed to.

Actions #15

Updated by stbuehler about 17 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to invalid

lighttpd will not support .htaccess: If it would, it wouldn't be "light" anymore and that is the point of lighty. Of course this means you cannot just replace apache with lighttpd if you use .htaccess.

And i don't see a bug here.

Actions #16

Updated by stbuehler over 16 years ago

  • Status changed from Fixed to Invalid
Actions #17

Updated by icy over 15 years ago

  • Missing in 1.5.x set to No

To anyone finding this ticket via google: Please see the FAQ

Actions

Also available in: Atom