Ich versuche schöne Permalinks auf meiner Wordpress-Installation zu aktivieren, aber keinen Erfolg. Ich ändere diese Datei /etc/nginx/conf.d/default.confZiemlich Perm Links auf NGINX für Wordpress - CentOS 7
Ich habe versucht, die folgenden:
server{
if (!-e $request_filename) { rewrite ^.*$ /index.php last;
server {
if ($host ~* ^myhost\.com$) {
rewrite ^(.*) http://www.myhost.com$1 permanent;
break;
}
location/{
try_files $uri $uri/ /index.php?q=$request_uri;
}
Aber keiner von diesen funktioniert :(. Hier ist meine vollständige Datei:
server {
listen 80;
server_name example.com;
return 301 http://www.example.com$request_uri;
}
server {
listen 80;
server_name www.example.com;
note that these lines are originally from the "location /" block
root /usr/share/nginx/html;
index index.php index.html index.htm;
location/{
root /usr/share/nginx/html;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Können Sie mir bitte helfen?
Vielen Dank.
'try_files $ uri $ uri//index.php? $ args; ' – Arcesilas
Auch: https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/ – Arcesilas
Haben Sie lesen die WordPress-Dokumentation zur Verwendung von nginx? https: //codex.wordpress.org/Nginx –