Join the community today
Become a Member

Wordpress wordpress fastcgi 404 sitemap

Discussion in 'Blogs & CMS usage' started by adzkii, Apr 24, 2020.

  1. adzkii

    adzkii Member

    38
    1
    8
    Apr 15, 2020
    Ratings:
    +3
    Local Time:
    7:33 AM
  2. eva2000

    eva2000 Administrator Staff Member

    45,454
    10,314
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,998
    Local Time:
    5:33 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    ah that guide is outdated IIRC you may need to change
    Code (Text):
    try_files $uri $uri/ /index.php?q=$request_uri;
    

    to
    Code (Text):
    try_files $uri $uri/ /index.php?q=$args;
    

    restart nginx and php-fpm
    Code (Text):
    nprestart

    let me know if that fixes it
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,454
    10,314
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,998
    Local Time:
    5:33 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    also if you're using a wordpress plugin to generate a site map, need to consult their documentation for specific additional nginx rewrite rules to add to your nginx vhost i.e. /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf for HTTPS based vhost

    i.e. for Yoast SEO I have these in my nginx vhost just above my wpsecure_mydomain.com.conf include file
    Code (Text):
    #Yoast SEO Sitemaps
    location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
      ## this rewrites sitemap.xml to /sitemap_index.xml
      rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
      ## this makes the XML sitemaps work
      rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 last;
      rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
      rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
      ## The following lines are optional for the premium extensions
      ## News SEO
      rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
      ## Local SEO
      rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
      rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
      ## Video SEO
      rewrite ^/video-sitemap.xsl$ /index.php?yoast-sitemap-xsl=video last;
    }
    
      include /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf;
     
  4. adzkii

    adzkii Member

    38
    1
    8
    Apr 15, 2020
    Ratings:
    +3
    Local Time:
    7:33 AM
    do i change that under # Wordpress Permalinks example in my vhost?
    the current one is try_files $uri $uri/ /index.php?q=$uri&$args;

    how can i change that to direct sitemap_index to sitemap only?
    i'm using https://wordpress.org/plugins/autodescription/
     
    Last edited: Apr 24, 2020
  5. eva2000

    eva2000 Administrator Staff Member

    45,454
    10,314
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,998
    Local Time:
    5:33 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yes

    you'd have to ask autodescription folks if they support nginx and what nginx rewrite rules you need to use or just switch to Yoast SEO plugin instead
     
  6. adzkii

    adzkii Member

    38
    1
    8
    Apr 15, 2020
    Ratings:
    +3
    Local Time:
    7:33 AM
    got it working but redirects to sitemap_index instead, i'm fine with that :)