I would like to use Grav on lighttpd/1.4.35 with PHP 5.6.6.

Is there a how-to for this (converting the .htaccess and so on)?

I’ve not tested on lighttpd (although it seems i’ve tried every other major web server out there). However, the main thing is the rewrite rule for the url pathing. This is exactly the same as wordpress or joomla. Something like this should work:

That should be enough to get Grav functioning properly.

The rest of the .htaccess is really some security lock down stuff to stop people pointing their browser at system directories. For that you will need to probably need to recreate those with lua function that is beyond my expertise. Some googling for Joomla examples should provide the information you need.

Hello. I’m trying to use Grav on lighttpd too. I lack the necessary knowledge to convert the .htaccess file for the links to be redirected. I can only see the default Main page but cannot see my custom pages.
I visited that r00tshell link and read it carefully, but it didn’t help. Any hint on the right direction would be appreciated!

I tested lightspeed and just used the exact same htaccess rules and it worked fine.

Thanks for your answer.
By lightspeed you mean Lighttpd webserver I guess.
If that’s the case, could you please tell me if you did something special? like editing the /etc/lighttpd/lighttpd.conf file or something like that.
I followed the Grav tutorial, created a new page (02.mypage/ and “/grav” shows it on the upper Grav menu bar. But when I click it… I go straight to lighttpd’s 404 page.
If I edit the /user/config/system.yaml file and change “home: alias: ‘/home’” to “home: alias: ‘/mypage’” then “/grav” shows my custom page, but then I cannot go to the default ‘main’ page in 01.main.
I’ve learned something about configuring redirects and rewrites with Lighttpd but I dont understand what should I redirect and where to.
Thanks in advance.

Oh sorry. Confused myself. I was thinking litespeed as I recently tested that. Lighttpd is different and I’ve never used it.

However if you can find help for Wordpress, the rewrite rules should be the same.

Well, I’ve managed to make it work finally. I read tons of stuff regarding redirect and rewrite, and yet the solution was so simple… At least I learned something in the process :slight_smile:
With some help from people on the chat I knew exactly what to google for.
The important .htaccess rules to translate were these ones:

1: RewriteCond %{REQUEST_URI} !^/index\.php
2: RewriteCond %{REQUEST_FILENAME} !-f
3: RewriteCond %{REQUEST_FILENAME} !-d
4: RewriteRule .* index.php [L]

It reads as something like “if the URI isn’t ‘index.php’ and the filename is neither an actual file nor a directory, then rewrite the request and send it to index.php, then stop checking for rewrites” (please forgive my interpretation’s low accuracy, I learned this in just one evening).
By adding the following code at the end of lighttpd.conf everything worked neatly.

# This converts lines 2 and 4. 
# Line 3 has no equivalent on Lighttpd
url.rewrite-if-not -file = ( 
   "^/path_to_grav/(.*)" => "/path_to_grav/index.php" 

I’m not sure if I should try to convert line 1 as this solution just works perfectly… for now.