如何將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. 在應用配置文件 app.php 中找不到’route_check_cache’配置項2. html按鍵開關如何提交我想需要的值到數據庫3. gvim - 誰有vim里CSS的Indent文件, 能縮進@media里面的4. Android中能不能判斷一個數據庫是create來的,還是open來的?5. HTML 5輸入框只能輸入漢字、字母、數字、標點符號?正則如何寫?6. javascript - 請教如何獲取百度貼吧新增的兩個加密參數7. 跟著課件一模一樣的操作使用tp6,出現了錯誤8. PHP類屬性聲明?9. javascript - 求助canvas繪制馬賽克的問題,老是取色不準10. html - 微信瀏覽器h5<video>標簽問題
