Hello @bananasmoothii
I hope you’re doing well!
Please go to your site’s wp-admin, to Settings > Permalnsk, set pretty permalinks, and save changes. Check if the map will load.
If this will not work, have a look at the suggestion provided here:
https://www.digitalocean.com/community/questions/404-when-using-pretty-permalinks-on-new-wordpress-site-on-lemp-nginx
https://nginxlibrary.com/wordpress-permalinks/
Otherwise, please contact your hosting provider so they could provide you the correct rules.
Kind regards,
Nastia
hay @bananasmoothii how can you fix your blog for your sitemap? i have same trouble like that. i have some website on my server, and some website on cpanel, while i go to my website (my server self) its always be like this. 404 not found.
my problem , but while my website migrated to cpanel, sitemap is on.
what can i do for this problem.
thanks.
and sorry for my bad english.
Well, for now, I’m just using another sitemap plugin (google xml-sitemap or something like that), because this plug-in provide some rewrite rules if you get 404 not found, and these work. For the robots.txt, well, It still not working, but I feel like it is not necessary.
Hello @penyintasdelusi
I trust you’re doing well!
Please try the adding teh following rules to teh server config and see if this will work for you:
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
rewrite ^/sitemap.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=index last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=$1&wds_sitemap_page=$2 last;
}
Kind regards,
Nastia
`location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
rewrite ^/sitemap.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=index last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=$1&wds_sitemap_page=$2 last;
}`
Will this work for the robots.txt too ?
Hi @bananasmoothii
It’s not quite the same, I’m afraid.
This code for sitemap.xml implements “pretty link” kind of rewrite but robots.txt file is different and it can either be “virtual” or a real physically existing file.
The latter shouldn’t be an issue and should be available anyway so I suppose it’s the virtual one. In that case, try adding this code, additionally, to nginx config:
location = /robots.txt {
try_files $uri $uri/ /index.php?$args;
access_log off;
log_not_found off;
}
Best regards,
Adam
Hello @bananasmoothii
I hope you are doing well!
We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.
Kind regards,
Nastia
hello @wpmudev-support9
im sorry for late response.
i still have issue about my sitemap, before this my web (telkomuniversity.ac.id/sitemap.xml) always go to 404 nginx error, (my server is nginx)
after that i just add this :
location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
rewrite ^/sitemap.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=index last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?wds_sitemap=1&wds_sitemap_type=$1&wds_sitemap_page=$2 last;
} on server config like you’ve said. But my page just go to my problem
please, help me to solve this problem.
(sorry for bad english) thank you.
Hello @penyintasdelusi ,
Please open separate ticket for your issue per forum regulations.
kind regards,
Kasia