CMS Routing

0 views
Skip to first unread message

Brendan Rice

unread,
Jul 22, 2008, 4:40:50 PM7/22/08
to Castle Project Users
Hi All,

I am trying to come up with a route that would enable me to add
dynamic content i.e pages.

So if my unrouted URL was http://www.myURL.com/defaultController.ashx?pageId=1
I would load a page that was dynamically build up from a database.

The problem I have is that I want the pages to make sense to Google
for better ranking. The above URL would not be good enough I would
need something l like the following:

http://www.myURL.com/myCategory/myPage
http://www.myURL.com/myCategory/mySubCategory/myPage
i.e.
http://www.myURL.com/tents/2-man
http://www.myURL.com/tents/aTentMaker/2-man

I was trying to use the following routing rule but it was catching
everything even requests for JavaScript files and spitting the dummy.

Could anyone please help me with this?

Thanks

Brendan

RoutingModuleEx.Engine.Add(
new PatternRoute("/<controller>/[action]/[id]")
.DefaultForAction().Is("index")
.DefaultForArea().Is(null)
.DefaultFor("controller").Is<PageController>());

Sean Chambers

unread,
Jul 22, 2008, 6:19:35 PM7/22/08
to Castle Project Users
At first glance, you don't need to specify the area under
DefaultForArea. it will set it to null if nothing is specified.

I had a similar scenario where I created a cms in monorail, although
my paths were pre-defined and only refernced by id so the routes were
pretty simple.

I would be interested in how you can get this to work with dynamic
paths. Take a look at the pattern route tests, as they gave me a good
idea what was possible with the new routing when I first started
playing with it.

Sean


On Jul 22, 4:40 pm, Brendan Rice <gumps...@googlemail.com> wrote:
> Hi All,
>
> I am trying to come up with a route that would enable me to add
> dynamic content i.e pages.
>
> So if my unrouted URL washttp://www.myURL.com/defaultController.ashx?pageId=1
> I would load a page that was dynamically build up from a database.
>
> The problem I have is that I want the pages to make sense to Google
> for better ranking.  The above URL would not be good enough I would
> need something l like the following:
>
> http://www.myURL.com/myCategory/myPagehttp://www.myURL.com/myCategory/mySubCategory/myPage
> i.e.http://www.myURL.com/tents/2-manhttp://www.myURL.com/tents/aTentMaker/2-man
Reply all
Reply to author
Forward
0 new messages