我的网站以前在共享主机上运行良好,但是将其迁移到新的AWS Lightail服务器后,我无法访问我的sitemap.xml
,该网站重定向到sitemap.xml.php
以动态表示站点地图。 / p>
Mod_rewrite
已启用。
这是我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included,if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now,rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule sitemap\.xml sitemap.xml.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
但是如果我通过sitemap.xml
进行访问,index.php
是可行的。尽管没有index.php
,但我的网站重置令人担忧。
我的虚拟主机文件已启用AllowOverride
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
我尝试了以下解决方案
RewriteRule ^sitemap\.xml$ sitemap.xml.php [L]
和
RewriteBase /
RewriteRule ^sitemap\.xml$ sitemap.xml.php [L]
和
RewriteBase /
RewriteRule ^sitemap\.xml$ sitemap.xml.php [L]
RewriteRule sitemap.xml sitemap.xml.php [L]
和
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteRule ^sitemap\.xml$ sitemap.xml.php [L]
RewriteRule sitemap.xml sitemap.xml.php [L]
,但没有任何效果。我有什么想念吗?