admin管理员组文章数量:1130349
My website is setup where wordpress is installed in it's own subdirectory, but the content is served as though it's at the domain root.
(This wordpress codex page details the configuration)
Wordpress Url:
Site Url:
So in this case, urls get re-written to NOT include /wordpress in the url it serves pages from (although image urls do include it: /...).
URL for a page is: www.example/mypage/
NOT: www.example/wordpress/mypage/
but image link is: www.example/wordpress/wp-content/uploads/2018/12/25/image1.jpg
Question:
Do I put robots.txt and sitemap.xml in the "webiste root" directory on my server (example)
or its wordpress directory (example/wordpress) ?
I cannot find this particular case in any searches.
Also trial and error is not helping, because I get conflicting results from various sitemap and robot validators.
Additionally, it seems some plugin or some part of WordPress insists on creating Virtual sitemap (sitemap.xml.gz) and robot (robot.txt) files, which further exasperates my efforts to definitively determine the proper location to place these files for this common, but non-standard of setup.
My website is setup where wordpress is installed in it's own subdirectory, but the content is served as though it's at the domain root.
(This wordpress codex page details the configuration)
Wordpress Url: https://www.example/wordpress
Site Url: https://www.example
So in this case, urls get re-written to NOT include /wordpress in the url it serves pages from (although image urls do include it: https://www.example/wordpress/wp-content/uploads/...).
URL for a page is: www.example/mypage/
NOT: www.example/wordpress/mypage/
but image link is: www.example/wordpress/wp-content/uploads/2018/12/25/image1.jpg
Question:
Do I put robots.txt and sitemap.xml in the "webiste root" directory on my server (example)
or its wordpress directory (example/wordpress) ?
I cannot find this particular case in any searches.
Also trial and error is not helping, because I get conflicting results from various sitemap and robot validators.
Additionally, it seems some plugin or some part of WordPress insists on creating Virtual sitemap (sitemap.xml.gz) and robot (robot.txt) files, which further exasperates my efforts to definitively determine the proper location to place these files for this common, but non-standard of setup.
1 Answer
Reset to default 1You can safely place your robot.txt file as well as the sitemap.xml file into your websites root directory and NOT the WordPress directory.
When a robot visits your site, the first place it checks is http://sitename/robots.txt, hence you want to keep these files at the root of your domain.
You can also disallow what the robot has access to
User-agent: * # applies to all robots
Disallow: / # disallow indexing of all pages
Disallow: wordpress/wp-admin/
Disallow: wordpress/wp-includes/
Disallow: wordpress/wp-content/plugins/
W3
My website is setup where wordpress is installed in it's own subdirectory, but the content is served as though it's at the domain root.
(This wordpress codex page details the configuration)
Wordpress Url:
Site Url:
So in this case, urls get re-written to NOT include /wordpress in the url it serves pages from (although image urls do include it: /...).
URL for a page is: www.example/mypage/
NOT: www.example/wordpress/mypage/
but image link is: www.example/wordpress/wp-content/uploads/2018/12/25/image1.jpg
Question:
Do I put robots.txt and sitemap.xml in the "webiste root" directory on my server (example)
or its wordpress directory (example/wordpress) ?
I cannot find this particular case in any searches.
Also trial and error is not helping, because I get conflicting results from various sitemap and robot validators.
Additionally, it seems some plugin or some part of WordPress insists on creating Virtual sitemap (sitemap.xml.gz) and robot (robot.txt) files, which further exasperates my efforts to definitively determine the proper location to place these files for this common, but non-standard of setup.
My website is setup where wordpress is installed in it's own subdirectory, but the content is served as though it's at the domain root.
(This wordpress codex page details the configuration)
Wordpress Url: https://www.example/wordpress
Site Url: https://www.example
So in this case, urls get re-written to NOT include /wordpress in the url it serves pages from (although image urls do include it: https://www.example/wordpress/wp-content/uploads/...).
URL for a page is: www.example/mypage/
NOT: www.example/wordpress/mypage/
but image link is: www.example/wordpress/wp-content/uploads/2018/12/25/image1.jpg
Question:
Do I put robots.txt and sitemap.xml in the "webiste root" directory on my server (example)
or its wordpress directory (example/wordpress) ?
I cannot find this particular case in any searches.
Also trial and error is not helping, because I get conflicting results from various sitemap and robot validators.
Additionally, it seems some plugin or some part of WordPress insists on creating Virtual sitemap (sitemap.xml.gz) and robot (robot.txt) files, which further exasperates my efforts to definitively determine the proper location to place these files for this common, but non-standard of setup.
1 Answer
Reset to default 1You can safely place your robot.txt file as well as the sitemap.xml file into your websites root directory and NOT the WordPress directory.
When a robot visits your site, the first place it checks is http://sitename/robots.txt, hence you want to keep these files at the root of your domain.
You can also disallow what the robot has access to
User-agent: * # applies to all robots
Disallow: / # disallow indexing of all pages
Disallow: wordpress/wp-admin/
Disallow: wordpress/wp-includes/
Disallow: wordpress/wp-content/plugins/
W3
本文标签: Where to put robottxt and sitemapxml for wordpress installed in its own directory
版权声明:本文标题:Where to put robot.txt and sitemap.xml for wordpress installed in its own directory 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749114933a2318029.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论