.htaccess - Rewrite conditions in htaccess -


i'm trying create sitemap multistore magento website. each shop-view has it's own sitemap. therefore have made

sitemap/store_en/sitemap.xml

sitemap/store_de/sitemap.xml

sitemap/store_nl/sitemap.xml

what i'm trying achieve redirect on request of mydomain.nl/sitemap.xml mydomain.nl/sitemap/store_nl/sitemap.xml

this have put in htaccess file. doesn't work. can see i'm doing wrong?

##rewrite rule de sitemaps  rewritecond %{http_host} ^.*mydomain.nl$ rewriterule ^sitemap.xml$ /sitemap/store_nl/sitemap.xml [nc] 

i have rewrite rule. don't know if of influence...

 rewritebase /  rewritecond %{request_filename} !-f  rewritecond %{request_filename} !-d  rewritecond %{request_uri} !(.*)/$  rewritecond %{request_uri} !(.*)\.(html|shtml|php)$  rewriterule ^(.*)$ http://%{http_host}/$1/ [l,r=301] 

thanks in advance!

directives mod_rewrite read , processed top bottom. in case had redirect in top. rules matches (sitemap.xml not file, or directory, not end slash, html, shtml or php). add slash it, , redirect request.

now new request comes in /sitemap.xml/. first rule not match (ends slash) , second rule not match (request not end xml, xml/). serve 404 error.

when switching rules, url (/sitemap.xml) matched against first rule, , matches. rewritten. on second pass first rule not match, , second rule not match (valid file).


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -