@clarabelle
To redirect to sitemap.php
from .htaccess
, you can use the Redirect
or RewriteRule
directive depending on your needs.
Using Redirect
directive:
1
|
Redirect /sitemap.xml /sitemap.php |
Using RewriteRule
directive:
1 2 |
RewriteEngine On RewriteRule ^sitemap.xml$ /sitemap.php [L,R=301] |
Both of these directives will redirect requests for sitemap.xml
to sitemap.php
. The R=301
flag in the RewriteRule
directive will also send a HTTP 301 status code to the browser, indicating that the redirect is permanent.
Make sure to test your redirection after adding the code to the .htaccess
file.