VPS侦探论坛

 找回密码
 注册
查看: 5244|回复: 2

wordpress地图重写规则问题

[复制链接]
发表于 2014-7-3 22:21:12 | 显示全部楼层 |阅读模式

用Yoast WordPress SEO插件里的地图报错 如下:
  1. As you're on NGINX, you'll need the following rewrites:

  2. rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
  3. rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
复制代码




用Google XML Sitemaps插件里的地图报错 如下:
  1. rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
  2. rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
  3. rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
  4. rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
复制代码


请问重写规则应放在那个文件里 wordpress.conf? nginx.conf?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-7-4 09:23:54 | 显示全部楼层


wordpress.conf
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-7-16 20:58:07 | 显示全部楼层

添加上去,然后重启lnmp  还是没反应
  1. location / {
  2. if (-f $request_filename/index.html){
  3.                 rewrite (.*) $1/index.html break;
  4.         }
  5. if (-f $request_filename/index.php){
  6.                 rewrite (.*) $1/index.php;
  7.         }
  8. if (!-f $request_filename){
  9.                 rewrite (.*) /index.php;
  10.         }
  11. }

  12. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  13. rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
  14. rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
复制代码



不是这样吗
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 23:22 , Processed in 0.025353 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表