wordpress頁面的預設連結形式採用」樸素」方式(例如: http://網域/?p=123)
這樣的動態URL連結不便於搜尋引擎的收錄, 為此, 我們需設定為其他幾種常見的固定連結形式, 如http://www.sufaith.com 選擇的是【 自訂結構】.
設定方式如下:
進入wordpress後台系統首頁, 點選選單【設定】- 【固定連結】
server { listen 80; server_name www.example.com; root /usr/local/www/wordpress; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; } rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }修改完配置後, 重啟nginx即可生效, 恢復正常訪問.
systemctl restart nginx.service