wordpress地图重写规则问题
用Yoast WordPress SEO插件里的地图报错 如下:As you're on NGINX, you'll need the following rewrites:
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap(+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
用Google XML Sitemaps插件里的地图报错 如下:
rewrite ^/sitemap(-+(+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/sitemap(-+(+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/sitemap(-+(+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/sitemap(-+(+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
请问重写规则应放在那个文件里 wordpress.conf? nginx.conf? wordpress.conf 添加上去,然后重启lnmp还是没反应
location / {
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;
}
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap(+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
不是这样吗
页:
[1]