WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
No sitemap generated under nginx server ? (9 posts)

  1. nadlerz
    Member
    Posted 2 years ago #

    WordPress version: 3.4.1
    WordPress SEO version: 1.2.5

    When I visit the sitemap url, it does not display any sitemap, instead i ge:

    <strong>404 Not Found
    
    nginx</strong>

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. Pothi
    Member
    Posted 1 year ago #

    Did you try the rewrite rules mentioned in the FAQ?

  3. nadlerz
    Member
    Posted 1 year ago #

    How to implement this in nginx?
    I'm just using a shared host.
    On what file should I add the rewrites ?

    Thanks !

  4. Pothi
    Member
    Posted 1 year ago #

    I don't know how to implement it on a shared host. This is the first time, I hear that a shared host uses nginx. There is no particular file (like .htaccess for Apache) to implement it on the fly. You could ask your host to see, if they could help.

  5. rahul286
    Member
    Posted 1 year ago #

    @nadlerz
    Which URL you have checked? /sitemap.xml OR /sitemap_index.xml ?

    In Yoast SEO plugin URL sitemap location is changed sometime back.

    Following 3 lines will take care of old sitemap link as well as new ones.

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

    As you are on shared hosting try asking your support? They will do this for you.

  6. cloudmaster
    Member
    Posted 1 year ago #

    I'm on WP 3.4.2 & WP SEO 1.2.8.5. I'm getting the same 404 as the OP but

    a) Don't understand where to put the rewrite rules (I'm using NginX)
    b) @rahul, I'm just using the 'You can find your XML Sitemap here' button in the plugin

    Also just noticed that the plugin isn't generating a new sitemap after creating a new post

  7. rahul286
    Member
    Posted 1 year ago #

    a) Don't understand where to put the rewrite rules (I'm using NginX)

    You can put them in server {..} block in nginx for your site.

    @rahul, I'm just using the 'You can find your XML Sitemap here' button in the plugin

    You also need to check if you have proper read-write permission on server. Plugin must be able to create sitemaps first. Looks like a permission issue as well.

  8. rahul286
    Member
    Posted 1 year ago #

    @cloudmaster
    by file permission I meant if u have a old sitemap.xml or sitemap_index.xml or sitemap.xml.gz present in your root dir, delete them.

    Actually, it looks like Yoast SEO plugin generates sitemaps on the fly (on multisite). If you have old sitemaps file physically present your request may not reach plugin

  9. popac
    Member
    Posted 1 year ago #

    Solution is so simple nadlerz

    The only "problem" is that you use plugin who generate XML on the fly.

    You need to check your nginx settings
    Location on server:
    (/etc/nginx/ and /etc/nginx/conf.d)
    (you can use WINSCP software for navigation)

    open nginx.conf (if there's your

    server {.....}

    part for websites or go to conf.d folder and open vhost.conf

    then find something like:

    location ~* "\.(js|ico|gif|jpg|png|css|html|htm|xml |swf|htc|bmp|cur)$" {

    or where you noticed that stands "xml" and simple delete this

    location ~* "\.(js|ico|gif|jpg|png|css|html|htm|swf|htc|bmp|cur)$" {

    After that you need to restart nginx with commands

    nginx - stop
    nginx

    I hope that this guide help you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic