AUTO RESOLVED - lighttpd subfolders redirect to root

Posted by ricodahalvarez 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
AUTO RESOLVED - lighttpd subfolders redirect to root
January 08, 2019 01:48PM
Hi there,

first of all, best wishes for this year 2019!
And also congratulations for the marvelous piratebox project!

I am currently working on a modification of the piratebox (on the Raspberry pi 3 B+), with the objective of accessing php applications (cms, forum, chat, wiki). All these applications are totally limited to their folder, which contains all the files necessary for their operation.

I only use flat-file applications without database like Bludit.

To access these applications via the browser, I had to activate php in the folder /opt/piratebox/www/ by activating fastcgi-php in /opt/piratebox/conf/lighttpd/lighttpd.conf (I also enabled mod_rewrite):

include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf"


I also modified /opt/piratebox/conf/lighttpd/fastcgi-php.conf this way:

$HTTP["url"] =~ "^/" {
        fastcgi.server = (
                ".php" => ((
                                "bin-path" => "/usr/bin/php-cgi",
                                "socket" => "/tmp/php.socket",
                                "max-procs" => 1
                        ))
        )
}


My application folders are accessible either when I create them directly in /opt/piratebox/www/ or /opt/piratebox/share/ with a symbolic link in /opt /piratebox/www/

My problem is that if the home page is accessible, all the subfolders that I point to with the browser redirect me to /content at the root of the piratebox.

Do you have any idea how to change the configuration of lighttpd so that these folders are accessible without redirecting to /content?

=> Solution:
The problem is caused by .htaccess in lighttpd. So:

$HTTP["url"] =~ "^/" {
        fastcgi.server = (
                ".php" => ((
                                "bin-path" => "/usr/bin/php-cgi",
                                "socket" => "/tmp/php.socket",
                                "max-procs" => 1
                        ))
        )
        url.rewrite-if-not-file = ( "^/path-to-app/(.*)" => "/path-to-app/index.php?q=$1" )

}

;-)

٠̩̩̩ЯI☪⚉ ḍḁ ㅒД╰ṽᴬ®Е☡



Edited 5 time(s). Last edit at 01/09/2019 11:20PM by ricodahalvarez.