最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
nginx下wordpress子目录伪静态设置步骤详解
时间:2022-06-25 18:48:16 编辑:袖梨 来源:一聚教程网
网站访问目录为http://show.*a*b*c.com/ ,但是wordpress是装在他下面的manage目录中的,所以访问到的首页也该是http://show.*a*b*c.com/manage/
而wordpress默认访问文章的URL是http://show.*a*b*c.com/manage/?p=12 的形式,需要做伪静态使文章访问形式为http://show.*a*b*c.com/manage/12
在nginx中配置如下:
server {
listen 80;
server_name show.abc.com;
access_log logs/access_show.abc.com.log;
error_log logs/error_show.abc.com.log;
index index.html index.php;
location / {
root /web/html/show;
}
location /manage/ {
try_files $uri $uri/ /manage/index.php;
}
location /manage/wp-content {
alias /web/html/show/manage/wp-content;
}
location /manage/wp-includes {
alias /web/html/show/manage/wp-includes;
}
location /manage/wp-admin {
alias /web/html/show/manage/wp-admin;
}
location ~ .php$ {
root /web/html/show;
fastcgi_pass 127.0.0.1:9001;
fastcgi_param SCRIPT_FILENAME /web/html/show$fastcgi_script_name;
include fastcgi_params;
}
}
相关文章
- 绯月絮语阵容怎么搭配 绯月絮语阵容搭配推荐 12-23
- 千机阵在哪预约 千机阵预约入口 12-23
- 千机阵官网网址是什么 千机阵官网入口 12-23
- 塞尔达无双封印战记疾风突击使用指南 疾风突击怎么用 12-23
- 艾尔登法环黑夜君临据点怎么选 四大据点主要情况介绍 12-23
- 艾尔登法环黑夜君临符文怎么获得 如何获得强力符文 12-23