E
E
Egor2015-09-10 15:37:01
Apache HTTP Server
Egor, 2015-09-10 15:37:01

How to convert htaccess rewrite rules to lighttpd?

Good afternoon.
I faced the task of quickly porting the site from the Apache host to lighttpd.
The first, of course, with which the question arose - the rules of rewriting.
I can't convert this htaccess correctly

RewriteEngine On
RewriteRule ^images/.*$ index.php
RewriteCond %{REQUEST_URI} !(^/_)|(error\.html)$ [NC]
RewriteRule ^.*$ index.php

In the rules for lighttpd
I can't correctly describe the rules for the second line:
What do we have now, but the server does not see the parameters after the ? for a url like " http://mysite.com/history/?id=25 "
url.rewrite-if-not-file += (
  "^images/.*$" => index.php,
  "^.*$" => index.php,
)

Help, please, master.
Navigation in the script is quite nasty:
$arr_request = explode('/',$_SERVER['REQUEST_URI']);
if ($arr_request[1] == 'status' && isset($_POST['ajax'])) {
//.. и тут соответствующий инклуд

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor, 2015-09-10
@GOshaSaveiko

So, it looks like everything went like this:

#/mnt/sdcard/pws/rewrite.conf

# rewrite rules
url.rewrite-if-not-file += (
    "^images/.*$" => "index.php",
    "^([^\?]+)(?:\?(.*))$" => "index.php?_route_=$1&$2",
    "^.*$" => "index.php"
)
# //rewrite rules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question