J
J
jakiro01022021-07-08 12:16:07
htaccess
jakiro0102, 2021-07-08 12:16:07

Access on htAcess how to make xml file access on file with php script?

There is a sitemap autogenerator that generates a map in a php file and outputs it to the sitemap.xml file. But the site has an English version of the site which is located in the /en/ directory, how can I make it work there as well?
htAccess which redirects from sitemap.xml to sitemap.php and returns a map:

#автогенератор sitemap
#для русской версии сайта
<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

  #Доступ карты сайта с sitemap.xml на sitemap.php
  RewriteRule ^sitemap\.xml$ sitemap\.php [L]
</IfModule>

htAccess itself is in the root, the English version is in the /en/ directory

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-07-08
@shambler81

RewriteRule ^en/sitemap\.xml$ en/sitemap\.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question