/ Wordpress

Wordpress 网站二级目录伪静态

Apache环境:

网站根目录.htaccess  文件添加:

RewriteRule /文件夹名称/(.*) /文件夹名称/$1 [L]

Nginx环境:

网站域名.conf  文件添加:

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; } }

Wordpress 网站二级目录伪静态
Share this