jeudi 29 janvier 2015

Convert Lighttpd rewrite to Nginx [new]

I've seen lots people asking about converting Lighttpd to Nginx but haven't seen my example in it's total form. If anyone could help, please!


I want to convert:



url.rewrite = (
"^/includes/(.*)$" => "/includes/$1",
"^/templates/(.*)$" => "/templates/$1",
"^/css/(.*)$" => "/css/$1",
"^/classes/(.*)$" => "/classes/$1",
"" => "/index.php/$1"
)


I tried using:



location / {
try_files $uri $uri/ /index.php?$args;
}


But if I link directly to a resource, it displays it instead of rewriting back to index.php


I also wondered if this might work, but it doesn't seem to:



rewrite ^/includes/(.*)$ /includes/$1 break;
rewrite ^/classes/(.*)$ /classes/$1 break;


Any suggestions would be greatly appreciated.


Thanks, E





Aucun commentaire:

Enregistrer un commentaire