ich habe hier eine htaccess, dessen Regeln ich gerne in meinen Nginx-Server-Block verwenden möchte. Ich komm leider als unerfahrener Apache-User nicht auf eine funktionierende Lösung.
Die htaccess beinhaltet:
Code: Alles auswählen
Options -Indexes
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f
RewriteRule ^(.*)$ public/$1 [QSA,END]
RewriteCond %{REQUEST_FILENAME} !index\.php
RewriteRule ^(.+)$ index.php?route=$1 [QSA,L]

Code: Alles auswählen
location / {
rewrite ^(.*)$ /public/$1;
rewrite ^(.+)$ /index.php?route=$1 break;
}
Code: Alles auswählen
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-handler;
fastcgi_index index.php;
include fastcgi_params;
}
Damit hats dann geklappt:
Code: Alles auswählen
location = /index.php {
# PHP options
}
location / {
try_files /public$uri /index.php?route=$uri;
}