Wordpress更换目录后链接跳转Nginx规则
› 社区话题 › bbPress 论坛系统(bbPress Forum System) › bbPress 链接重构与批量替换操作指南(NewVFX 案例) › Wordpress更换目录后链接跳转Nginx规则
2025年8月24日 - 下午8:02 #1010
追光
管理员
然后最近对wordpress核心站点的文章和目录做了链接调整的nginx规则
# 所有 vfx-software 目录跳转到 download/vfx-university-footage/vfx-software/
location ~ ^/vfx-software/(.*)$ {
return 301 https://www.newvfx.com/download/vfx-university-footage/vfx-software/$1;
}
# vfx-university-footage 内部素材跳转到 download 目录
location ~ ^/vfx-university-footage/(.*)$ {
return 301 https://www.newvfx.com/download/vfx-university-footage/$1;
}
# audio-footage 跳转
location ~ ^/audio-footage/?$ {
return 301 https://www.newvfx.com/download/audio-footage;
}
location ~* /wp-admin/admin-ajax\.php$ {
allow all;
include fastcgi_params;
fastcgi_pass unix:/tmp/php-cgi-82.sock; # 按你的 php 配置改
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_intercept_errors off;
add_header Access-Control-Allow-Origin "https://www.newvfx.com";
add_header Access-Control-Allow-Credentials "true";
}