Hi,
context.redirectToPage won't work because it always adds a .xsp to the url.
But you could use this SSJS code in your button:
<xp:button value="Label" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<![CDATA[#{javascript:
var appUrl = facesContext.getExternalContext().getRequest().getContextPath();
var url = appUrl + "?logout&redirectto=" + appUrl;
facesContext.getExternalContext().redirect(url);
}]]>
</xp:this.action>
</xp:eventHandler>
</xp:button>
Hope this helps
Sven