mod-rewrite rule for sitemap.xml
-
I am using a CMS that hosts multiple websites simultaneously and I am seeking a method to properly serve sitemap.xml files for each site. I have concluded that a mod-rewrite rule will be the most effective solution for this. My idea is to have a /sitemaps/ directory with the site map for each domain named as the domain name, i.e. /sitemaps/acmewidgets.com.xml Since the appropriate sitemap url would be acmewidgets.com/sitemap.xml I need assistance with creating a mod-rewrite rule that will map this accordingly. Thank you!
-
Answer:
RewriteRule /?sitemap.xml %{DOCUMENT_ROOT}/sitemaps/%{HTTP_HOST}.xml [L]
sterling at Stack Overflow Visit the source
Related Q & A:
- If Horner’s rule is used what is the number of multiplications to compute P(n) for an polynomial?Best solution by Mathematics
- How to convert build.xml to maven pom.xml file?Best solution by Stack Overflow
- When did Alexander the Great rule?Best solution by Yahoo! Answers
- Which molecule obeys the octet rule?Best solution by en.wikipedia.org
- Tennis challenge rule?Best solution by ehow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.