problem with .htaccess conversion
Added by Umberto over 9 years ago
Hi guys,
I'm Umberto from Italy and I'm writing you because I need your help to solve a problem with a migration from Apache to Lightpd.
I have a website that use .htaccess rewrite and I have to convert these rules in the correct code to insert in the lighttpd configuration file. Actually I still have problem with some pages but I don't undrstand where is the problem.
Here the .htacces code:
RewriteEngine On AddType image/svg+xml svg svgz AddEncoding gzip svgz ErrorDocument 404 /pagine_lingua/404.php ################# # ITALIANO ################# # area amministrazione RewriteRule ^pannello_controllo/funzioni/(.*).php$ /area_amministrazione/funzioni/function_parser.php [L,QSA] RewriteRule ^pannello_controllo/([A-Za-z0-9-_\.]*)$ /area_amministrazione/$1 [L,QSA] #front end RewriteRule ^(homepage.php|login.php|)$ /pagine_lingua/homepage.php [L,QSA] #salvagente RewriteRule ^messaggi/([A-Za-z0-9\-\_\.]*).php$ /pagine_lingua/messaggi/$1.php [L,QSA] RewriteRule ^ordini/([A-Za-z0-9\-\_\.]*).php$ /pagine_lingua/ordini/$1.php [L,QSA] RewriteRule ^calendario/([A-Za-z0-9\-\_\.\/]*).(php|htm|html)$ /pagine_lingua/calendario/$1.$2 [L,QSA] RewriteRule ^settings/([A-Za-z0-9\-\_\.]*).php$ /pagine_lingua/settings/$1.php [L,QSA] RewriteRule ^fornitore_settings/([A-Za-z0-9\-\_\.]*).php$ /pagine_lingua/fornitore_settings/$1.php [L,QSA] RewriteRule ^([A-Za-z0-9\-\_\.]*).php$ /pagine_lingua/$1.php [L,QSA]
And here there is what I write for the conversion in the lighttpd file confuguration:
index-file.names = ("index.php", "index.html", "index.htm", "home.php","home.html","home.htm") # Put your rewrite into url.rewrite-once section, I create example to rewrite drupal and wordpress url.rewrite-once = ( #"^pannello_controllo/funzioni/(.*).php$" => "/area_amministrazione/funzioni/function_parser.php" #,"^pannello_controllo/([A-Za-z0-9-_\.]*)$" => "/area_amministrazione/$1 "^/(homepage\.php|login\.php|\:8080)$" => "/pagine_lingua/homepage.php" ,"^/messaggi/([A-Za-z0-9-_\.]*)\.php((\?|\&)[0-9a-z]+\= [0-9a-z]*)*$" => "/pagine_lingua/messaggi/$1.php$2" ,"^/ordini/([A-Za-z0-9-_\.]*)\.php((\?|\&)[0-9a-z]+\= [0-9a-z]*)*$" => "/pagine_lingua/ordini/$1.php$2" ,"^/calendario/([A-Za-z0-9-_\.]*)\.php((\?|\&)[0-9a-z]+\= [0-9a-z]*)*$" => "/pagine_lingua/calendario/$1.php$2" ,"^/settings/([A-Za-z0-9-_\.]*)\.php((\?|\&)[0-9a-z]+\= [0-9a-z]*)*$" => "/pagine_lingua/settings/$1.php$2" ,"^/([A-Za-z0-9-_\.]*)\.php((\?|\&)[0-9a-z]+\= [0-9a-z]*)*$" => "/pagine_lingua/$1.php$2" ) server.error-handler-404 = "/pagine_lingua/404.php"
Where is the mistake? I really go crazy and after read a lot of documentation I'm here to ask the community help.
Thanks in advance
Umberto