0

I have 3 websites running in 1 install of Magento 2. There I have created for each store a sitemap. But how can i add the sitemap in webmaster tools?

The sitemap link start all with www.deal-finder.nl. But when I want to add it into webmaster tools it ask a sitemap with his own url, like www.uitverkoopgigant.nl.

How can i fix this?

0

First, create a new folder called sitemaps in the root of your website, then create subfolders for each domain.

/sitemaps/domain_1/
/sitemaps/domain_2/

Then login to the Magento admin and navigate to –

catatlog -> google sitemap

Create or edit the sitemap listings for each store and set the “path to sitemap” field to be the path you created for the store.

/sitemaps/domain_1/
/sitemaps/domain_2/

Update your robots.txt file. To make sure that the search engine spiders are properly directed to the new sitemaps. You may need to update or create the robots.txt file. Edit the robots.txt file and add the following lines at the top —

# Website Sitemap
Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml

Finally, if your site uses the Apache web server engine, you should update the .htaccess

file in the root of your website to direct any other sitemap requests to the proper place. Locate the following line below the line that reads —

RewriteEngine on

And add the following redirect statements below it —

#Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_1\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_1/sitemap.xml [NC,L,R=301]

#Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_2\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_2/sitemap.xml [NC,L,R=301]

And that’s it. Make sure to regenerate the sitemaps for all your stores and then try to view them in the browser. You can test the .htaccess redirects by navigating in your browser to http://www.domain_1.com/sitemap.xml and http://www.domain_2.com/sitemap.xml to make sure that the links actually go to the correct sites.

Source :

https://www.human-element.com/sitemaps-magento-multistore/

https://support.google.com/webmasters/answer/75712?hl=en

0

Not sure if this helps but here's how I add sitemaps to Google and Bing:

I created a file public_html/cron/sitemap-auto-submit-en.php

In sitemap-auto-submit-en.php I have this:

<?php
/*
* Sitemap Submitter
* Use this script to submit your site maps automatically to Google, Bing.MSN and Ask
* Trigger this script on a schedule of your choosing or after your site map gets updated.
*/
//Set this to be your site map URL
$sitemapUrl = "http://www.example.com/sitemaps/en/sitemap.xml";

// cUrl handler to ping the Sitemap submission URLs for Search Engines…
function myCurl($url){
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_exec($ch);
  $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);
  return $httpCode;
}

//Google
$url = "http://www.google.com/webmasters/sitemaps/ping?sitemap=".$sitemapUrl;
$returnCode = myCurl($url);
return_code_check($url, $returnCode);
echo "<p>Google Sitemaps has been pinged (return code: $returnCode).</p><br /><br />";

//Bing / MSN
$url = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$sitemapUrl;
$returnCode = myCurl($url);
return_code_check($url, $returnCode);
echo "<p>Bing / MSN Sitemaps has been pinged (return code: $returnCode).</p><br /><br />";


function return_code_check($pingedURL, $returnedCode) {

$to = "admin@example.com"; 
$subject = "Sitemap Submission Notice English";
$message = "URL Pinged is: ".$pingedURL."    Returned Code ".$returnedCode.""; 
$headers = "From: admin@example.com"; 
mail($to, $subject, $message, $headers); 
}

Then I added the following cron in CPanel:

cd /home/angelsforeveryon/public_html/cron; php -q sitemap-auto-submit-en.php

Not the answer you're looking for? Browse other questions tagged or ask your own question.