【发布时间】:2018-06-08 19:13:38
【问题描述】:
我有一个 cakephp 网站,我在 webroot 文件夹中找到了 sitemap.php。 我想将 .htaccess 文件中的 url 重写为 sitemap.xml 但普通的 php 技术不起作用。 我尝试使用以下内容。
RewriteRule ^sitemap\.xml$ xmlsitemap.php [L]
RewriteRule ^sitemap$ sitemap.php [L]
但它在 cakephp 中不起作用。 知道怎么做吗?任何建议将不胜感激。
【问题讨论】:
-
你为什么不直接使用sitemap.xml来显示你的XML站点地图?
-
您能用您的整个 htaccess 代码编辑您的问题吗?另外,与您的根目录相比,
webroot位于何处?