Warning: include_once(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include_once(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include_once(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/advanced-cache.php on line 22

Warning: include(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 95

Warning: include_once(): open_basedir restriction in effect. File(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php) is not within the allowed path(s): (/www/wwwroot/www.rixin.info/:/tmp/) in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118

Warning: include_once(/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: Operation not permitted in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118

Warning: include_once(): Failed opening '/www/wwwroot/rixin.info/www/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:') in /www/wwwroot/www.rixin.info/www/wp-content/plugins/wp-super-cache/wp-cache.php on line 118
Nginx设置WordPress二级目录伪静态化|网站建设

Nginx设置WordPress二级目录伪静态化

日新博客的二级目录网站建设开始启用了,目前先转载了几篇文章,主要是我现在还没有考虑好以后怎么样进行网站建设,这个二级目录的关键词应该怎么选择,如何能够将这个二级目录建设好呢?

当我在考虑这些的时候,突然发现发表的文章访问都是404错误,原来我的Nginx没有设置Wordpress二级目录伪静态化,这个伪静态化还是主目录的,所以出现上述404错误,那么如何设置Wordpress二级目录伪静态化呢?

Nginx设置WordPress二级目录伪静态化

Nginx设置WordPress二级目录伪静态化

普通伪静态下,在conf下面写下面的代码

location /
{
	 try_files $uri $uri/ /index.php?$args;
}
 
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

而二级目录伪静态,则需要新加入以下代码:

如果是在宝塔中,只需要网站列表-伪静态-在默认的wordpress代码下加入下面的代码,即可实现二级目录伪静态

location /二级目录名称/ {
index index.html index.php;
if (-f $request_filename/index.html){
  rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
  rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
  rewrite (.*) /二级目录名称/index.php;
 }
}

Nginx设置WordPress二级目录伪静态化

我提供一张本站Nginx设置WordPress二级目录伪静态化规则的图片,/t/为二级目录,请注意将代码中需要修改的/二级目录名称/修改成为/t/,请注意这个/t/一定要修改成你自己的二级目录名称,当我再次打开网页时,已经正常显示内容了。

Nginx设置WordPress二级目录伪静态化:等您坐沙发呢!

发表评论

表情
还能输入210个字