我正在使用 codeigniter 生成一个包含 XML 数据的页面。该文件的 URL 位于 /index.php/sitemap,但我希望通过 /sitemap.xml 访问该 URL
我的.htaccess
文件已经修改为允许用户访问 URL 而无需在 URL 之前输入 /index.php/。这是.htacess
我正在使用的文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteRule ^sitemap\.xml$ index.php/sitemap [L]
一切正常,除了 sitemap.xml 文件的重定向。我在运行 XAMPP 的 Windows 机器上
我究竟做错了什么?