Project

General

Profile

[Solved] dynamic alias.url not working

Added by john about 1 year ago

url.rewrite-if-not-file = (
"^/(test)/(.*)" => "$0"
)

If I added below alone (without url.rewrite-if-not-file), it does not work
alias.url = (
"/test/" => "/usr/local/test/"
)

2nd issue
I trying to achieve this url http://example.com/[a-z]/phpmyadmin (a-z is sess token)

alias.url = (
"^/(.*)/phpmyadmin/" => "/usr/local/phpmyadmin/index.php/$1"
)

is not working


Replies (7)

RE: dynamic alias.url not working - Added by gstrauss about 1 year ago

alias.url matches the URL prefix. It does not take regex arguments.
alias.url maps a URL prefix to a physical path. It does not remap to another URL.
https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModAlias

For what it appears you are trying to do, you want to use mod_rewrite, and then map the url /phpmyadmin/ to be handled by a .php file via CGI or FastCGI (not in the URL)

RE: [Solved] dynamic alias.url not working - Added by zorgos about 1 month ago

hi,

I've got the same 2nd issue. How do you do that with mod_rewrite? I don't find...

Need to have something like that:

alias.url +=("/web/username/(.*)/" => "/path/to/dir/")

RE: [Solved] dynamic alias.url not working - Added by zorgos about 1 month ago

No patch? Nothing except php&co? Is it a joke?

RE: [Solved] dynamic alias.url not working - Added by zorgos about 1 month ago

AliasMatch is great...

RE: [Solved] dynamic alias.url not working - Added by gstrauss 23 days ago

Is it a joke?

zorgos: your english is subpar and so are your mannerisms. Trolls are summarily dismissed. Please go away.

A suggested solution was provided further above the troll's comments.

RE: [Solved] dynamic alias.url not working - Added by zorgos 18 days ago

I'm not a diplomat, that's all. Neither English... I know that we can rewrite the url but in my case it doesn't solve theproblem, or if it is possible I didn't find out how. The dinamic url is used on mod_dirlisting. The problem is not to redirect to a directory, the problem is to rewrite the url on the links created by mod_dirlisting.
If I rewrite http://www.blabla.com/bla/[0.9]/ to map to /web/, the links created by mod_dirlisting do not include the dynamic value in the url...

Hoping to be sufficiently clear.

RE: [Solved] dynamic alias.url not working - Added by gstrauss 18 days ago

The problem is not to redirect to a directory, the problem is to rewrite the url on the links created by mod_dirlisting.

There are many, many CGI scripts that can be used to generate directory listings. Instead of using mod_dirlisting, use your favorite search engine to find one that you like and can easily modify to generate whatever links that you like. Use mod_indexfile and have the indexfile point to a CGI script which you can use to generate the dirlisting page with the links that you desire. See Index-file-names_Details

    (1-7/7)