Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在index.php中实现sitemap.xml,以生成与/mysitemap的链接?_Php_Heroku_Indexing_Web_Sitemap - Fatal编程技术网

如何在index.php中实现sitemap.xml,以生成与/mysitemap的链接?

如何在index.php中实现sitemap.xml,以生成与/mysitemap的链接?,php,heroku,indexing,web,sitemap,Php,Heroku,Indexing,Web,Sitemap,我的桌面上有一个文件夹,我想是我的根文件夹,其中有一个home.html文件和一个index.php文件,在git bash的帮助下,我实现了一个在heroku中运行的网页。我确信我的sitemap.xml文件必须与其他两个文件一起放在我桌面的文件夹中,我的问题是,我应该在index.php文件中编写什么代码才能获得这样的地址?并且能够查看我的sitemap.xml并被谷歌搜索控制台识别 这是我的页面:,应该是这样的您应该使用生成站点的sitemap.xml,并将其放在Web服务器的根目录中,或

我的桌面上有一个文件夹,我想是我的根文件夹,其中有一个home.html文件和一个index.php文件,在git bash的帮助下,我实现了一个在heroku中运行的网页。我确信我的sitemap.xml文件必须与其他两个文件一起放在我桌面的文件夹中,我的问题是,我应该在index.php文件中编写什么代码才能获得这样的地址?并且能够查看我的sitemap.xml并被谷歌搜索控制台识别
这是我的页面:,应该是这样的

您应该使用生成站点的sitemap.xml,并将其放在Web服务器的根目录中,或者,如果您想用另一个名称将其存储在另一个位置,您可以将此行放在robots.txt中

Sitemap: http://example.com/sitemap_location.xml

你需要某种重写规则。这不是你放在
index.php
中的东西。