RSS
 

Multiple domains pointing to dasBlog

10 Oct

I have a couple of domains (http://vasanth.in and http://www.vasanth.in) pointing to this blog. My blog uses dasBlog and dasBlog caches the homepage. The cache is cleared when a new post is done. This works great when a single domain points to the blog.


With two domains the cache is not cleared on both domains. Say I update my blog using the admin page in http://vasanth.in, the new post does not show up in http://www.vasanth.in. Strange! There seems to be two separate applications running one on each domain with their own caches.


Anyway I have to investigate more into this. But as a quick fix touching the web.config seems to restart both the applications and clear the caches. To make this easier I wrote a simple aspx page I can call to touch the file. When I googled for the above problem I found that a few people were looking for such a code. So here it is.



<%@ Page Language=“C#” %>
<%@ import Namespace=“System.IO” %>

<html>
<head>
<script runat=“server”>
string output = “Failed!”;
private void Page_Load(Object sender, EventArgs e)
{
        string filename = “<path to your web.config>\\web.config”;
        if (File.Exists(filename))
        {
            File.SetLastWriteTime(filename, DateTime.Now);
            output = “Success!”;
        }    
}
</script>
<title>Application Restarter</title>
</head>
<body>
Restarted Application: <%=output%>
</body>
</html>


 

Related posts:

  1. Creating Macros for dasBlog
  2. dasBlog Extra Macros 1.2
  3. dasBlog Extra Macros Update
  4. dasBlog Extra Macros
  5. Running multiple instances of IE

 
Comments Off

Posted in Dot Net, Software, dasBlog

 

Comments are closed.