sitemap in htaccess

#204266
  • Resolved Rich
    Rank Math free

    Hi, I’m having some issues with my site https://www.modish.co.nz. I migrated it yesterday from an old domain to another. When I ask Google Search Console to index a page it says blocked by robots.txt but my robots.txt file is just a basic WP one –

    User-Agent: *
    Allow: /wp-content/uploads/
    Disallow: /wp-content/plugins/
    Disallow: /wp-admin/
    Disallow: /readme.html
    Disallow: /refer/

    Sitemap: https://www.modish.co.nz/sitemap_index.xml

    I looked at your sitemap doc and using https://www.modish.co.nz?sitemap=1 shows the sitemap. Do I add the code (as per your sitemap doc) above the “wordpress” section in .htaccess or below or does it not matter? My site is one Siteground. Here is my htaccess file-
    # HTTPS forced by SG-Optimizer
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    # END HTTPS
    # BEGIN WordPress
    # The directives (lines) between “BEGIN WordPress” and “END WordPress” are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    I also have a couple of 301 re-directs that don’t work most are working) e.g. this one https://www.modish.co.nz/soap-cutter which should re-direct to https://www.modish.co.nz/product/multi-bar-soap-cutter/ but it goes to my WordPress login page!

    Kind regards
    Rich

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.

    I checked your robots.txt configuration and it seems to be working fine and it should not return any issues for your sitemap.

    Adding this sitemap URL (https://www.modish.co.nz/sitemap_index.xml) in your robots file should be enough for Google to recognize it. You don’t have to add the URL *?sitemap=1 as they both generate the same file.

    Could you please remove your sitemaps from your Google Search Console and resubmit your primary sitemap (https://yourdomain.com/sitemap_index.xml)? After that, give Google some time to recrawl your website and see if the error goes away.

    As for your Redirection issue, may I know if this redirection is made by Rank Math?

    We are looking forward to helping you with this one.

    Rich
    Rank Math free

    Hi Jeremy,
    Thanks for your reply, appreciate it. I’ve removed the sitemaps from GSC and added the one as suggested. GSC says “couldn’t fetch” and “sitemap could not be read”. Will it come right in a few days?

    Yes, I have the redirects in Rank Math. There are two re-directs that are not working – they re-direct to my wordpress login page which is a bit strange.
    Should I delete and re-enter them?

    Thanks
    Rich

    Ankit
    Rank Math business

    Hello,

    Thank you for your reply.

    Everything on your website seems to be in a working condition, Your robots.txt is correct, You have no X-robot tag defined. I can reach your website and able to access the sitemap file, I even checked your website on SERPs, One of your URLs is recently indexed, See this screenshot. And also could you please share the screenshot of your GSC?

    Looking forward to helping you.

    Rich
    Rank Math free

    Thanks very much for that. Yes, Google SC seems to be working now – that’s great, thank you!

    There are still two redirects in Rank Math (one listed above) that bring up my WordPress login page instead of the new page. I have just deactivated them in Rank Math to see what happens. Maybe there’s a cache I need to flush?

    Thanks for you help
    Rich

    Ankit
    Rank Math business

    Hello,

    Thank you for your reply.

    I am glad things worked for you.

    Could you please share the screenshot of your redirection rules so we can also check in on our end?

    Looking forward to helping you.

    Rich
    Rank Math free

    Thanks for that. There are two not working i.e. the ones without dates in right column of this image https://imageshack.com/i/poyJ6meqp

    https://imageshack.com/i/pm61Co9ip

    The others seem to be working. Thanks very much – would be great to get these working.

    Rich

    Ankit
    Rank Math business

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Rich
    Rank Math free

    Thanks I’ll keep that in mind. I have a feeling it might be an issue at Siteground as I remember contacting them 18 months ago to get those exact product pages re-directed. Maybe they have a re-direct stored somewhere other than my htaccess file as I can’t find it in there. I’ll get back to you in a day or two to either close the job or give you access to my WP and ftp.

    Ankit
    Rank Math business

    Hello,

    Thank you for getting back to us.

    Meanwhile, Please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

The ticket ‘sitemap in htaccess’ is closed to new replies.