Adding the [L] flag to both your sitemap rules should do the trick.

Ralf Eggert wrote:
Hi,

I currently use these two lines to get all requests handled by my
bootstrap file index.php except the robots.txt file which should not be
rewritten.

  RewriteEngine on
  RewriteRule ^(.*)/$ /$1 [L,R=301]
  RewriteRule !robots\.txt$ index.php

Now I want all requests like /sitemap.xml or /sitemap42.xml to be
handled by a sitemap.php file. I added these lines:

  RewriteRule ^sitemap\.xml$ sitemap.php
  RewriteRule ^sitemap([0-9]+)\.xml$ sitemap.php?id=$1

Unfortunately, all the sitemap requests are still handled by my
bootstrap file and so an file not found error is shown. I also put these
two lines just below the "RewriteEngine on" line but that still did not
work.

How do I need to change my .htaccess file to get what I want?

Thanks and best regards,

Ralf

Reply via email to