Ich versuche, Nginx so zu konfigurieren, dass alle Anforderungen an http://domain.com/path
in http://domain.com/
umgeschrieben werden.Nginx Rewrite Pfade zu Basis-URL
Ich möchte keine Weiterleitung, weil ich möchte, dass die URL immer noch den ursprünglichen Pfad anzeigen.
Beispiel Rewrites:
http://domain.com/path/index.php -> http://domain.com/index.php
http://domain.com/path/category/books -> http://domain.com/category/books
http://domain.com/path/books.php?q=harry -> http://domain.com/books.php?q=harry
versuchte ich alias
und root
aber ich konnte sie nicht an die Arbeit.
location /path
{
root /var/www/html/;
}
location /path
{
alias /var/www/html/;
}
Warum ist diese Frage mit '.htaccess 'markiert, wenn es sich um einen' nginx'-HTTP-Server handelt? – arkascha
Entschuldigung, ich habe es falsch markiert! – Charles