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