php:将sitemap.xml移动到文件夹中
有一个网站具有由php:将sitemap.xml移动到文件夹中,php,.htaccess,Php,.htaccess,有一个网站具有由.htaccess文件归档的多语言功能 我已经生成了sitemap.xml文件,可以通过sitename.com/sitemap.xml 有一点php经验,我会问如何将.xml文件“移动”到一个地方,以便通过sitename.com/ro/sitemap.xml?您可以将sitemap.xml保存在根文件夹中,并将此规则添加到DocumentRoot中。htaccess: RewriteEngine On RewriteBase / RewriteRule ^ro/(sitem
.htaccess
文件归档的多语言功能
我已经生成了sitemap.xml
文件,可以通过sitename.com/sitemap.xml
有一点php经验,我会问如何将.xml文件“移动”到一个地方,以便通过
sitename.com/ro/sitemap.xml
?您可以将sitemap.xml
保存在根文件夹中,并将此规则添加到DocumentRoot
中。htaccess:
RewriteEngine On
RewriteBase /
RewriteRule ^ro/(sitemap\.xml)$ /$1 [L,NC]
现在您可以将此URL用作http://sitename.com/ro/sitemap.xml
让我们来看看。