如何將wordpress安裝在子目錄中?nginx配置文件該怎樣寫?
問題描述
我想在根目錄中安裝一個靜態網站,在子目錄中安裝wordpress(/blog/)應該如何設置?
問題解答
回答1:server { listen 80; server_name XXXXX.com; root/var/www/XXXXX.com; location / {index index.html index.htm; } location /blog {index index.html index.htm index.php;try_files $uri $uri/ /blog/index.php?$args; } location ~ .php$ {fastcgi_split_path_info ^(.+.php)(/.+)$;if (!-f $document_root$fastcgi_script_name) { return 404;}fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;include fastcgi_params;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/var/run/php5-fpm.sock; }}
相關文章:
1. objective-c - ios百度地圖定位問題2. html - css 如何添加這種邊框?3. javascript - 求助這種功能有什么好點的插件?4. html5 - 如何解決bootstrap打開模態modal窗口引起頁面抖動?5. javascript - 求助關于js正則問題6. javascript - node.js服務端渲染解疑7. html5 - rudy編譯sass的時候有中文報錯8. javascript - 關于定時器 與 防止連續點擊 問題9. 為何 localStorage、sessionStorage 屬于html5的范疇,但是為何 IE8卻支持?10. 微信開放平臺 - Android調用微信分享不顯示
