google sitemap生成器使用方法Word格式.docx

上传人:b****3 文档编号:7633503 上传时间:2023-05-08 格式:DOCX 页数:73 大小:36.63KB
下载 相关 举报
google sitemap生成器使用方法Word格式.docx_第1页
第1页 / 共73页
google sitemap生成器使用方法Word格式.docx_第2页
第2页 / 共73页
google sitemap生成器使用方法Word格式.docx_第3页
第3页 / 共73页
google sitemap生成器使用方法Word格式.docx_第4页
第4页 / 共73页
google sitemap生成器使用方法Word格式.docx_第5页
第5页 / 共73页
google sitemap生成器使用方法Word格式.docx_第6页
第6页 / 共73页
google sitemap生成器使用方法Word格式.docx_第7页
第7页 / 共73页
google sitemap生成器使用方法Word格式.docx_第8页
第8页 / 共73页
google sitemap生成器使用方法Word格式.docx_第9页
第9页 / 共73页
google sitemap生成器使用方法Word格式.docx_第10页
第10页 / 共73页
google sitemap生成器使用方法Word格式.docx_第11页
第11页 / 共73页
google sitemap生成器使用方法Word格式.docx_第12页
第12页 / 共73页
google sitemap生成器使用方法Word格式.docx_第13页
第13页 / 共73页
google sitemap生成器使用方法Word格式.docx_第14页
第14页 / 共73页
google sitemap生成器使用方法Word格式.docx_第15页
第15页 / 共73页
google sitemap生成器使用方法Word格式.docx_第16页
第16页 / 共73页
google sitemap生成器使用方法Word格式.docx_第17页
第17页 / 共73页
google sitemap生成器使用方法Word格式.docx_第18页
第18页 / 共73页
google sitemap生成器使用方法Word格式.docx_第19页
第19页 / 共73页
google sitemap生成器使用方法Word格式.docx_第20页
第20页 / 共73页
亲,该文档总共73页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

google sitemap生成器使用方法Word格式.docx

《google sitemap生成器使用方法Word格式.docx》由会员分享,可在线阅读,更多相关《google sitemap生成器使用方法Word格式.docx(73页珍藏版)》请在冰点文库上搜索。

google sitemap生成器使用方法Word格式.docx

Beforeyoubegin

TheGoogleSitemapGeneratorisaPythonscriptthatcreatesaSitemapforyoursiteusingtheSitemapProtocol.ThisscriptcancreateSitemapsfromURLlists,webserverdirectories,orfromaccesslogs.Inordertousethisscript:

∙Youmustbeabletoconnecttoandrunscriptsonyourwebserver.

∙YourwebservermusthavePython2.2orlaterinstalled.

∙YoumustknowthecommandthatlaunchesPython.(Generally,thisispython,butmayvarybyinstallation.Forinstance,ifthewebserverhastwoversionsofPythoninstalled,theearlierversionmaybeinvokedbythecommandpythonandthelaterversionmaybeinvokedbythecommandpython2.)

∙Youmustknowthedirectorypathtoyoursite.Ifyourwebserverhostsonesite,thismaybeapathsuchasvar/www/html.Ifyouhaveavirtualserverthathostsmultiplesites,thismaybeapathsuchashome/virtual/site1/fst/var/www/html.

∙Youmustbeabletouploadfilestoyourwebserver(forinstance,usingFTP).

∙IfyouwillbegeneratingalistofURLsbasedonaccesslogs,youmustknowtheencodingusedforthoselogsandthecompletepathtothem.

Ifyouaren'

tsureaboutanyofthis,youcancheckwithyourwebhostingcompany.

Nowyou’rereadytogetstarted.Here’sanoverviewofwhatyou’llneedtodo.

1.DownloadtheSitemapGeneratorprogramfiles.Extractthefilestoalocaldirectory.

2.Createaconfigurationfileforyoursiteusingtheprovidedexample_config.xmlfileasatemplate.Modifythisfileasneededforyoursiteandsaveit.

3.Uploadthenecessaryfilestoyourwebserver.

4.Runsitemap_gen.py.

5.AddthegeneratedSitemaptoyourGooglewebmastertoolsaccount.

6.Setuparecurringscript.(optional)

IfyouareunabletousetheSitemapGenerator,youcanaddaSitemaptoyourGooglewebmastertoolsaccountinanotherformat,suchasasimpletextfile.Third-partyprogramssupportingtheSitemapProtocol.

ForNewsSitemaps:

TheSitemapGeneratorisnotrecommendedforuseincreatingGoogleNewsSitemapsatthistime,duetothespecialrequirementsofNewsSitemaps.NewsSitemapsareintendedtobedynamiclistsofonlythemostrecentlypublishednewsarticles(ratherthantheentirewebsite),andtheyareupdatedfrequently.

1.DownloadingtheSitemapGeneratorprogramfiles

TheSitemapGeneratorfilesareavailableinZIPandGZarchiveformatsfromthefollowinglocation:

Onceyoudownloadthearchive,extractitintoalocaldirectory.Locatethefollowingfiles:

∙README—containsthelatestinformationaboutthistool

∙sitemap_gen.py—thepythonscriptthatgeneratesyourSitemap

∙example_config.xml—thetemplateconfigurationfileyou’llusetospecifytheconfigurationforyoursite

∙example_urllist.txt—thetemplateURLlistyoucanuseifyouwishtocreateaSitemapbasedonasetofURLsthatyouspecify

2a.Creatingaconfigurationfile

Thissectionprovidesstep-by-stepinstructionsforcreatingaconfigurationfile.Italsoprovidesacompletereferenceoftheoptionsavailable.IfyouarecreatingMobileSitemaps,seetheadditionalmobileguidelines.

Inordertocreateaconfigurationfileforyoursite,youmusthavethefollowinginformation:

∙ThebaseURLforyoursite(suchasEnsurethatyouincludetheprotocol(suchashttp:

//).Forinstance,isavalidbaseurl,butisnot.

∙ThewebserverpathtothelocationwhereyouwanttostoretheSitemap.Generally,thisisthepathtothebaseURLastheSitemapcannotcontainURLsthatareinahigher-leveldirectoryfromthelocationoftheSitemap.WhenyouruntheGoogleSitemapGenerator,itcreatestheSitemapandplacesitinthelocationyouspecify.

∙ThemethodsyouwanttheSitemapGeneratortousetocreateyourSitemap.Youcanuseanycombinationofmethods.Thefollowingmethodsareavailable:

oURL—listindividualURLsinthissectionoftheconfigurationfile,alongwithinformationabouteachURL.YouwouldgenerallyusethismethodinconjunctionwithanothermethodtomanuallyincludeadditionalURLsthatothermethodswouldn'

tpickup.

oURLlist—pointtheconfigurationfiletoatextfilethatcontainsalistofURLs.YoumightwanttousethismethodifthistextfilealreadyexistsorifyouuseascripttogeneratealistofURLs.

oDirectorypaths—specifythedirectorypathsforyoursiteandcorrespondingURLstothosepaths.TheSitemapGeneratorwillcreatealistofURLsbasedonthecontentsofthosedirectories.YoumightwanttousethismethodifyoursiteconsistsofstaticHTMLfiles.

oAccesslogs—pointtothepathtoyourlogfiles.TheSitemapGeneratorwillcreatealistofURLsbasedontheURLsincludedinthelogs.Youmightwanttousethismethodifyoursiteconsistsofdynamicpages.

oSitemap—pointtoexistingSitemapsthatyouhavecreatedwiththeSitemapGenerator.TheSitemapGeneratorwillcreateasingleSitemapthatincludestheURLscontainedineachSitemap.YoucouldusethismethodifyouhavealreadycreatedseveralsmallerSitemapsthatyouwanttocombineintoonelargerSitemap.

Createtheconfigurationfileasfollows:

1.Opentheexample_config.xmlfileinatexteditor.Saveitasanewfile(suchasconfig.xmlormysite_config.xml).

2.Locatethesitedefinitionsection:

3.<

site

4.base_url="

5.store_into="

/var/www/docroot/sitemap.xml.gz"

6.verbose="

1"

>

7.Changethebase_urlvaluetotheURLforyoursite.

8.Changethestore_intovaluetothepathonyourwebserverwhereyouwanttostoretheSitemapandthefilenameyouwanttousefortheSitemap.Generally,thisisthepathtothebaseURLsinceGooglecanonlyacceptURLsthatareatthesamelevelasorsubdirectoriesofthedirectorythatholdstheSitemap.Youcanspecifyarelativepathfromthedirectorywhereyouuploadthescriptoracompletepathfromtherootofyourwebserver.IfyouuploadthescripttoyourbaseURLdirectory,youcansimplyspecifythefilename.

9.Locatethegenerationmethodsectionsthatbeginwith**MODIFYorDELETE**.EachofthesesectionscorrespondstoamethodforgeneratingaSitemap.

10.Deletethesectionsforthemethodsyouaren’tgoingtouse.

11.Followtheinstructionsbelowforthemethodsyouaregoingtouse.

URL

Locatethefollowingsection:

<

!

--**MODIFYorDELETE**

"

url"

nodesspecifyindividualURLstoincludeinthemap.<

br>

Requiredattributes:

href-theURL

Optionalattributes:

lastmod-timestampoflastmodification(ISO8601format)

changefreq-howoftencontentatthisURLisusuallyupdated

priority-value0.0to1.0ofrelativeimportanceinyoursite

-->

urlhref="

/>

url

href="

lastmod="

2004-11-14T01:

00:

00-07:

00"

changefreq="

yearly"

priority="

0.3"

/>

Thissectiongivestwoexamples:

thefirstincludesonlytherequiredattributeandthesecondincludestherequiredattributeaswellastheoptionalattributes.

UsethisformatforeachoftheURLsyouwanttoinclude.ThechangefreqattributegivesGoogleageneralideaofhowoftentheURLisupdated.ThishelpsGoogleknowhowoftentovisitthepagefornewcontent.ThepriorityattributegivesGoogleinformationabouttherelativeimportanceofthispagecomparedtotheotherpagesofyoursite.ThisattributehasnoeffectonhowGooglecomparesyourpagetopagesonothersites,itjusthelpsGoogleknowwhichpagesofyoursitethatyouthinkaremostimportant.

URLlist

--**MODIFYorDELETE**

urllist"

nodesnametextfileswithlistsofURLs.

Anexamplefile"

example_urllist.txt"

isprovided.

path-pathtothefile

encoding-encodingofthefileifnotUS-ASCII

urllistpath="

encoding="

UTF-8"

UsethisformattopointtothepathandnameofthetextfilethatcontainsyourlistofURLs.Youcanusetheprovidedexample_urllist.txtfileasatemplateforthattextfile.Youcanspecifyeitherarelativeorcompletepathtoyourwebserver.Forinstance,iftheSitemapGeneratorandurlist.txtfilearelocatedinthesamedirectory,youcansimplyspecifythefilenameofthe.txtfile,IfyoucreateatextfilewithanencodingotherthanUTF-8,youcanusetheencodingattributetoindicatethisencoding.Ifyouhavemultiple.txtfiles,youcanusewildcards.Forinstance:

example_urllist*.txt"

ForeachURLyouincludeinthetextfile,youcanspecifythelastmodificationdate,changefrequency,andpriority.SeetheURLlisttextfilereferencesectionforcompleteinformationaboutthestructureofthisfile.

Directorypaths

directory"

nodestellthescripttowalkthefilesystemand

includeallfilesanddirectoriesintheSitemap.

path-pathtobeginwalkingfrom

url-URLequivalentofthatpath

default_file-nameoftheindexordefaultfilefordirectoryURLs

<

directorypath="

/var/www/icons"

url="

directory

path="

/var/www/docroot"

default_file="

index.html"

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2