Domain modification at runtime?

Jan 31, 2011 at 4:06 PM

Is there a way to alter the URL in the sitemap generated at runtime?

My company uses a proxy so instead of the sitemap generating the external domain name (, it generates the internal address (webprod/).

See example at:

Is there a way to get around this that you may know of?


Feb 1, 2011 at 6:14 AM

In the file "SitemapHandler.cs" you will find this line


string siteUrl = Request.Url.Scheme + "://" + Request.Url.Host;


the scheme set above you will not need to worry about but the host is what you will probably need to change! I am not sure what too in the case but for this site in the mean time you can hard code as shown below. If you are .NET development savvy then you could remotely debug directly from the site and set a break point in the above shown code and see if you can find where your domain is hiding :-)

Give this a try and see what your results are like.


string siteUrl = Request.Url.Scheme + "://" + "";



Feb 1, 2011 at 11:16 AM

Thanks, I'll give it a try and see if I can get it to work that way.