Apache:无法将sitemap.xml重写为sitemap.php
我的web文档树的根htdocs/johndoe中有以下.htaccess文件,其中可以找到index.php:Apache:无法将sitemap.xml重写为sitemap.php,php,apache,.htaccess,sitemap,web.sitemap,Php,Apache,.htaccess,Sitemap,Web.sitemap,我的web文档树的根htdocs/johndoe中有以下.htaccess文件,其中可以找到index.php: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?lang=$1&menu1=$2&menu2=$3 [QSA,NC,L] Rewrite
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?lang=$1&menu1=$2&menu2=$3 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?lang=$1&menu1=$2 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?lang=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule sitemap.xml sitemap.php
不确定我做错了什么,但当我访问:
http://localhost/johndoe/sitemap.xml
它只是加载my index.php,而不是调用sitemap.php。我哪里做错了?谢谢。移动规则:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule sitemap.xml sitemap.php
就在RewriteEngine on指令之后,在.htaccess文件的顶部,似乎解决了我的问题