Exclude sitemap.xml from htaccess.
P粉814160988
P粉814160988 2023-07-20 16:17:03
0
1
512

When I try to access using /sitemap.xml, it just loads the home screen, nothing changes in the URL, no matter what I put after the slash, it gives me the home page.

I think the sitemap.xml file is not found, so the homepage is displayed. If I don't use .htaccess file it works fine.

This is the code for the .htaccess file:

RewriteEngine On
RewriteRule ^([^/]+)$ index.php?page= [QSA,L]
RewriteRule ^/$ index.php [NC]
P粉814160988
P粉814160988

reply all(1)
P粉304704653

You need to exclude it in the rewrite rules that currently capture sitemap.xml, for example by adding a rewrite condition in front to test if it is not a sitemap file name:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/sitemap.xml
RewriteRule ^([^/]+)$ index.php?page= [QSA,L]
RewriteRule ^/$ index.php [NC]
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!