Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
php:将sitemap.xml移动到文件夹中_Php_.htaccess - Fatal编程技术网

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

让我们来看看。