我进退两难。我将wordpress站点从Apapache服务器迁移到NGINX。
在此过程中,我在WP中更改了permalink。
/index.php/%postname%/
至
/%postname%/
现在,来自谷歌的用户由于永久链接的变化而获得404的服务。通常情况下,我只是通过WP插件重定向任何页面,但是由于permalink中的index.php,插件不能工作。因此,我别无选择,只能在NGINX文件中创建一个重定向。
请告诉我该怎么做。
发布于 2019-08-16 03:55:17
在服务器配置文件中(该文件将位于/etc/nginx/nginx.conf)。
如果它不存在,它也可能在/usr/local/nginx/conf/nginx.conf或/usr/local/etc/nginx/nginx.conf。
临时改道:
rewrite ^/oldlocation$ http://www.newdomain.com/newlocation redirect;永久重定向:
rewrite ^/oldlocation$ http://www.newdomain.com/newlocation permanent;发布于 2019-08-17 22:12:44
server {
rewrite ^/index.php/(.*)$ /$1 permanent;
...
}https://stackoverflow.com/questions/57516229
复制相似问题