Linux uses Shell to generate XML site map scripts

Source: Internet
Author: User

Some static page-oriented sites, may not be convenient to generate a sitemap. and in order to speed up seo/seo.html "target=" _blank "> Search engine collection, it is best to take the initiative to do a sitemap, through webmaster Tools to submit or write a file, so as to speed up Baidu, Google, etc. included.

Below to Baidu Sitmap as an example, the code implemented through the shell is as follows:

  code is as follows copy code

cd/data/ www
find.-name *.htm > Site.txt
sed-i ' s/.//http://news.361way.com//g ' site.txt
Echo ' <?xml version= ' 1.0 "encoding=" UTF-8 "?> ' >sitemap.xml
echo  ' <urlset> ' >> sitemap.xml
Cat Site.txt|awk ' {print "<url>" "N"
"<loc>" "</loc>" "N"
"<lastmod>" "2013-10-28" "</lastmod>" " N "
" <changefreq> "Always" "</changefreq>" "N"
"<priority>" "0.6" "</priority>" "N"
' </url> '} ' >>sitemap.xml
Echo ' </urlset> ' >> sitemap.xml

Use the above parameters, refer to the Baidu Sitemap help page.

As for Google Sitemap is similar, and Google in the collection of more civilian. Directly in the Google Webmaster Tools page Submission site to the open air, generally three days or so can be included. And Baidu only so-called high-quality users can submit site map

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.