UrlRewriter problem?

Sep 19, 2008 at 6:53 AM
Edited Sep 19, 2008 at 6:56 AM

Hi,
in a new project, based on 1.4.3.1 when I do this:
Response.Write(Custom.ciEvents.Url + "<br/>");
Response.Write(Custom.ciEvents.TemplateUrl + "<br/>");
Response.Write(Custom.ciEvents.Name + "<br/>");

I get
/t-events.aspx?page=19
~/t-events.aspx
events

where I expected
/events.aspx
~/t-events.aspx
events

The Url is not rendered correctly...
Anyone a hint as where I should look for a solution?

Coordinator
Sep 19, 2008 at 8:09 AM
Does the url rewriter recognize Custom.ciEvents.Parent as the start page? And see if addinga  node to <sites> makes any difference.
Sep 19, 2008 at 8:46 AM
Response.Write(Custom.ciEvents.Parent.Name + "<br/>") gives root, which is correct.
.Url is the same as TemplateUrl in the entire site...strange..

Changed the web.config, still the same.
    <n2>
        <host rootID="3" startPageID="4">
            <sites>
                <add id="1" name="localhost">
                </add>
            </sites>
            <web extension=".aspx" />
            <outputCache enabled="false" duration="10"/>           
        </host>       
        <engine>
            <globalization enabled="false"/>
            <scheduler keepAlive="true" interval="10"/>
            <assemblies>
                <add assembly="N2"/>
                <add assembly="N2.Edit"/>
                <add assembly="N2.Security"/>
            </assemblies>
        </engine>
        <edit>
            <installer checkInstallationStatus="false"/>
            <uploadFolders>
                <add path="~/Upload"/>
            </uploadFolders>
        </edit>
        <database connectionStringName="N2CMS" flavour="SqlServer2005"/>
    </n2>
Coordinator
Sep 19, 2008 at 10:39 AM
You're saying that Parent gives root. What happens if you move it to the start page? The url parser only makes friendly urls for pages that are under a start page.
Sep 19, 2008 at 12:42 PM
That's it...I wasn't paying attention, thanks!