Creating a Dynamic Sitemap Using Coldfusion - page 4

Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Step 4: Create a rewrite rule

At this stage if you go to http://yourdomain/sitemap.cfm you should see an xml file listing your url nodes. You could submit this to search engines as is but I prefer to hide that the file is dynamic by using this apache rewrite rule. (IIS has a similar url rewrite capability)

#Sitemap
RewriteRule ^sitemap.xml/?$ sitemap.cfm [L,NC]

So thats all there is to it. Now whenever googlebot crawls your site it will find an accurate up to date sitemap.xml file.

1 2 3 4

Reader Comments

David Tananbaum's Gravatar
David Tananbaum
Friday, December 18, 2015 at 3:37:43 PM Coordinated Universal Time

Are you available for assignment to redefine out sitemap code for the website as listed above?

David Tananbaum, Pesident
AtPrime media Services

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain advertisments or appear to be created for the purpose of link building, will not be published.

Archives Blog Listing