问题描述
我使用的同时托管多个网站的CMS和我正在寻求一种方法来正确地服务于sitemap.xml的文件为每个站点。我的结论是一个国防部重写规则将是这样做的最有效的解决方案。
我的想法是有一个/网站地图/目录下的网站地图命名为域名的各个领域,即/sitemaps/acmewidgets.com.xml
由于相应的Sitemap网址是acmewidgets.com/sitemap.xml我需要建立一个国防部重写规则,将映射此相应的帮助。
感谢您!
重写规则/?sitemap.xml%{DOCUMENT_ROOT} /站点地图/%{HTTP_HOST}的.xml [L]
I am using a CMS that hosts multiple websites simultaneously and I am seeking a method to properly serve sitemap.xml files for each site. I have concluded that a mod-rewrite rule will be the most effective solution for this.
My idea is to have a /sitemaps/ directory with the site map for each domain named as the domain name, i.e. /sitemaps/acmewidgets.com.xml
Since the appropriate sitemap url would be acmewidgets.com/sitemap.xml I need assistance with creating a mod-rewrite rule that will map this accordingly.
Thank you!
RewriteRule /?sitemap.xml %{DOCUMENT_ROOT}/sitemaps/%{HTTP_HOST}.xml [L]
这篇关于对于sitemap.xml的国防部重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!