• Resolved wantei202006

    (@wantei202006)


    Ok so recently I moved to a VPS, running Virtualmin (NginX).

    After restoring my blog from the backups, I reinstalled Yoast and tried to create a site map and it didn’t work, I kept getting a 404 error and I even checked using FTP and there was no file there (I also set it to display hidden files).

    So going through the web, I found people having the same problems and tried out their solutions-
    1) Refreshing Permalinks
    2) Changing .htaccess file
    3) Adding Nginx configuration
    But none of this worked.

    Even WP Jetpack was unable to create a sitemap.

    Can someone help me out?

    Update:
    I also checked using the plugin and the file editor only detects the robots.txt file, not the .htaccess file.

    • This topic was modified 7 years, 11 months ago by wantei202006.
    • This topic was modified 7 years, 11 months ago by wantei202006.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support amboutwe

    (@amboutwe)

    Sometimes strange behavior may be caused by a plugin or theme conflict. The fastest way to rule out conflicts is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Seventeen. If this resolves the issue, you have a conflict and should activate one plugin at a time until you locate the conflict. Finally, after all plugins are active, switch to your theme. This will narrow down the conflict to a specific plugin or theme.

    If you are unfamiliar with checking for conflicts, we wrote a small guide that will walk you through the steps. You can find it here: How To Check For Plugin Conflicts

    Thread Starter wantei202006

    (@wantei202006)

    I’ve tried what you told me, disabling all my plugins and changing to a basic theme, but the sitemap still isn’t created.

    Thread Starter wantei202006

    (@wantei202006)

    Here is what my htacces looks like

    # WordPress SEO - XML Sitemap Rewrite Fix
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
    </IfModule>
    # END WordPress SEO - XML Sitemap Rewrite Fix
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    and my nginx config (ikigainetwork.moe.conf)

    server {
    	server_name ikigainetwork.moe www.ikigainetwork.moe;
    	listen 81.4.104.56;
    	root /home/ikigainetwork/public_html;
    	index index.html index.htm index.php;
    	access_log /var/log/virtualmin/ikigainetwork.moe_access_log;
    	error_log /var/log/virtualmin/ikigainetwork.moe_error_log;
    	fastcgi_param GATEWAY_INTERFACE CGI/1.1;
    	fastcgi_param SERVER_SOFTWARE nginx;
    	fastcgi_param QUERY_STRING $query_string;
    	fastcgi_param REQUEST_METHOD $request_method;
    	fastcgi_param CONTENT_TYPE $content_type;
    	fastcgi_param CONTENT_LENGTH $content_length;
    	fastcgi_param SCRIPT_FILENAME /home/ikigainetwork/public_html$fastcgi_script_name;
    	fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    	fastcgi_param REQUEST_URI $request_uri;
    	fastcgi_param DOCUMENT_URI $document_uri;
    	fastcgi_param DOCUMENT_ROOT /home/ikigainetwork/public_html;
    	fastcgi_param SERVER_PROTOCOL $server_protocol;
    	fastcgi_param REMOTE_ADDR $remote_addr;
    	fastcgi_param REMOTE_PORT $remote_port;
    	fastcgi_param SERVER_ADDR $server_addr;
    	fastcgi_param SERVER_PORT $server_port;
    	fastcgi_param SERVER_NAME $server_name;
    	fastcgi_param HTTPS $https;
        location / {
                    try_files $uri $uri/ /index.php?$args; 
        }
    	location ~ \.php$ {
    		try_files $uri =404;
    		fastcgi_pass unix:/var/php-nginx/14911244012458.sock/socket;
    	}
    location ~* \.(txt|xml|js)$ {
        expires 8d;
    }
    
    location ~* \.(css)$ {
        expires 8d;
    }
    
    location ~* \.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$ {
        expires 8d;
    }
    
    location ~* \.(jpg|jpeg|png|gif|swf|webp)$ {
        expires 8d;
    }
    	listen 81.4.104.56:443 default ssl;
    	ssl_certificate /home/ikigainetwork/ssl.cert;
    	ssl_certificate_key /home/ikigainetwork/ssl.key;
    
    #Yoast sitemap
    location ~ ([^/]*)sitemap(.*)\.x(m|s)l$ {
    	rewrite ^/sitemap\.xml$ /sitemap_index.xml permanent;
            rewrite ^/([a-z]+)?-?sitemap\.xsl$ /index.php?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;
    
            ## following lines are options. Needed for wordpress-seo addons
            rewrite ^/news_sitemap\.xml$ /index.php?sitemap=wpseo_news last;
    	rewrite ^/locations\.kml$ /index.php?sitemap=wpseo_local_kml last;
    	rewrite ^/geo_sitemap\.xml$ /index.php?sitemap=wpseo_local last;
    	rewrite ^/video-sitemap\.xsl$ /index.php?xsl=video last;
    
    	access_log off;
    }
    
    }
    Plugin Support amboutwe

    (@amboutwe)

    Yoast SEO sitemaps can be loaded using two URLs, the pretty permalink one and a non-pretty permalink.

    Pretty Permalink: https://www.example.com/sitemap_index.xml
    Non-Pretty Permalink: https://www.example.com/?sitemap=1

    Does the display when using the non-pretty permalink? If so, the plugin successfully generated the sitemap and your server is not applying the redirect rules correctly.

    Please contact your webhost for assistance implementing the redirect rules for your server.

    Yoast XML Sitemaps on Apache servers
    Yoast XML Sitemaps on NGINX servers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Yoast Plugin cannot create sitemap’ is closed to new replies.