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
.htaccess htaccess不会将sitemap.php转换为sitemap.xml_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess htaccess不会将sitemap.php转换为sitemap.xml

.htaccess htaccess不会将sitemap.php转换为sitemap.xml,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,昨天我已经写了一篇关于.htaccess的问题的文章,多亏了用户@RavinderSingh13的帮助,我才解决了这个问题。现在又出现了一个小问题。我制作了sitemap.php,它负责通过从mysql数据库检索文件来创建站点地图。现在我需要将sitemap.php转换为sitemap.xml。但是.htaccess文件不允许我找到请求的文件。 目前我的.htaccess是: RewriteEngine ON ##Excluding Indexes and MultiViews options

昨天我已经写了一篇关于.htaccess的问题的文章,多亏了用户@RavinderSingh13的帮助,我才解决了这个问题。现在又出现了一个小问题。我制作了sitemap.php,它负责通过从mysql数据库检索文件来创建站点地图。现在我需要将sitemap.php转换为sitemap.xml。但是.htaccess文件不允许我找到请求的文件。 目前我的.htaccess是:

RewriteEngine ON

##Excluding Indexes and MultiViews options here.
Options -Indexes -MultiViews

DirectoryIndex home.php

##Rule for adding / at end of urls.
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

##Rules for non-existing pages to be served here.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ core.php [QSA,L]
我添加了这个,但不幸的是它不起作用

RewriteRule ^sitemap\.xml$ sitemap.php [L]

php文件位于站点的主根目录中。谁能帮帮我吗。非常感谢。

DirectoryIndex
行下方添加此站点地图规则。是否希望
sitemap.php到sitemap.xml
sitemap.xml到sitemap.php