-
my domain is “https://www.myincomerelaxation.com ,recently nonwww to www version changed , since then I am facing sitemap issue sir , please do the needul
-
Hello,
We apologize for the issue you are facing with your sitemap after changing from the non-www to the www version of your domain. This can often lead to sitemap accessibility issues due to the way URLs are structured.
Here are a few steps you can take to resolve this:
-
Flush Permalinks: Go to your WordPress dashboard, navigate to Settings → Permalinks, and simply click Save Changes. This can help refresh the permalink structure and may resolve the sitemap issue.
-
Check Sitemap URL: Ensure that you are submitting the correct sitemap URL to Google Search Console. It should be `https://img.youtube.com/vi/-QZro6QysCA/maxresdefault.jpg.
-
Update Robots.txt: Make sure that your
robots.txt
file is not blocking the sitemap. You can check this in Rank Math SEO → General Settings → robots.txt. -
Rewrite Rules: If you are using an Apache server, ensure that your
.htaccess
file has the correct rewrite rules for Rank Math sitemaps. Here’s a sample code you can add:# START of Rank Math Sitemap Rewrite Rules 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] RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L] # END of Rank Math Sitemap Rewrite Rules
-
Nginx Configuration: If you are using Nginx, ensure that your configuration file has the appropriate rewrite rules as well:
# START Nginx Rewrites for Rank Math Sitemaps rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; rewrite ^/([a-z]+)?-sitemap.xsl$ /index.php?xsl=$1 last; # END Nginx Rewrites for Rank Math Sitemaps
If these steps do not resolve the issue, please reply to this ticket with any specific error messages you are encountering, and a human agent from our support team will assist you further. Thank you for bringing this concern to our attention!
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank MathThis is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
This page contains the following errors:
error on line 2 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.As per your suggestions, I added the code at the .htacceess file,but it still showing the error, which shown above,
Please do the needful sir
ThiyagarajanHello,
Thank you for contacting us. We apologize for any inconvenience this issue may have caused.
This sitemap error indicates that there must be some white space before the XML Sitemap’s source code. You can also look at the source code of your Sitemap and see if there is an extra line before the XML.
This is usually caused by a blank line or space in your
wp-config.php
orfunctions.php file
.It is also very much possible that your sitemap’s xml tag is missing which might be creating a blank line.
Please follow this troubleshooting guide to fix that issue:
https://rankmath.com/kb/fix-sitemap-issues/#xml-text-declarationWe hope this helps. Please let us know if you have further questions or concerns.
Thank you.
-
You must be logged in to reply to this ticket.