Project

General

Profile

[Solved] redirect in dirlisting

Added by tankf33der 14 days ago

hi all,

Alpine Linux 3.19
lighttpd 1.4.73

Config is trivial:
http://pb1n.de/?9200db

Site with current config is:
http://pulsar.pb1n.de

You can not click on files to view content, it stuck somehow in last "rewrite-once" 3 lines.
If i comment last 3 lines all back to normal.

Thanks in advance,
Mike


Replies (13)

RE: redirect in dirlisting - Added by gstrauss 14 days ago

The matching (left) part of url.rewrite-once ("match" => "replace") pairs is a regex. Perhaps you mean url.rewrite-once = ("/$" => "/?C=N&O=A") ?
Please see mod_rewrite documentation for more details.

RE: redirect in dirlisting - Added by tankf33der 14 days ago

Configuration changed as you mentioned.

Now i do not see redirect by default and files are not sorted ascendingly.

RE: redirect in dirlisting - Added by gstrauss 14 days ago

You should read this carefully and provide more details about what you are trying to do.
How to get support

It is very, very, very likely that you have not written the lighttpd config to do what you want, and neither lighttpd nor I can read your mind.

See also DebugVariables

RE: redirect in dirlisting - Added by gstrauss 14 days ago

FYI: request to update Alpine 3.19-stable to lighttpd 1.4.76 has been submitted
https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/64430

RE: redirect in dirlisting - Added by gstrauss 14 days ago

Try this: url.rewrite-once = ("^[^?]*/$" => "$0?C=N&O=A")

RE: redirect in dirlisting - Added by tankf33der 14 days ago

Does not work too.

I would like to explain again what I want to get:
1. redirect http://pulsar.pb1n.de/ to http://pulsar.pb1n.de/?C=N&O=A for sorting of dir.listing
AND
2. allow view content on any txt file in it.

reading docs and googling for two days already.

Thanks.

RE: redirect in dirlisting - Added by gstrauss 14 days ago

Does not work too.

How descriptive. I don't think you read How to get support or DebugVariables

Anyway, works for me.

Make sure that you properly restart lighttpd after changing the config.

RE: [Solved] redirect in dirlisting - Added by tankf33der 14 days ago

1. Insert your string to config, save
2. type "service lighttpd restart" in shell
3. open new firefox, clear "Everything" in History, open Private window.
4. put url http://pulsar.pb1n.de in firefox and NO redirect to http://pulsar.pb1n.de/?C=N&O=A

RE: [Solved] redirect in dirlisting - Added by tankf33der 14 days ago

Of course I am.
Thats why I am here.

RE: [Solved] redirect in dirlisting - Added by tankf33der 14 days ago

hi all,

All this time i spent on my problem with this.
I took your variant is main candidate, this is the best I have right now.
Installed alpine Edge with 1.4.76 to be sure i am ok.

1.
Your morning variant is:
url.rewrite-once = ("^[^?]*/$" => "$0?C=N&O=A")
This is installed on pulsar.pb1n.de right now.

2. To understand it is ok i changed it to:
url.rewrite-once = ("^[^?]*/$" => "$0?C=M&O=A")

char "N" to "M"
now sort by date then by name

so, when you will open pulsar.pb1n.de to check, you will see small arrow, it should be around column "Last Modified:" because of "M" but i see around column "Name".

(mike)

RE: [Solved] redirect in dirlisting - Added by gstrauss 14 days ago

To understand it is ok i changed it to:
url.rewrite-once = ("^[^?]*/$" => "$0?C=M&O=A")

char "N" to "M"
now sort by date then by name

The query string parameters for mod_dirlisting are documented on mod_dirlisting Table Sorting

Are you mistaking mod_rewrite for mod_redirect?

Of course I am.
Thats why I am here.

And yet you seem to have ignored the strong hint. Did you try reading mod_redirect?
url.redirect = ("^[^?]*/$" => "$0?C=M&O=A")

RE: [Solved] redirect in dirlisting - Added by tankf33der 14 days ago

hi,

Works now. Thanks a lot.
I have my strong weaknesses and "redirect" in web servers (lighttpd and etc) is one of them.
Thanks a lot again,
(mike)

    (1-13/13)