Parsing dynamic url's that don't exist and redirect to actual url

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
11/8/2009 1:36:55 PM
Gravatar
Total Posts 26

Parsing dynamic url's that don't exist and redirect to actual url

Hi

I've been asked to add a new function to my mojo website - user wants to be able to go to a page called something like, country_GB.aspx, from which I parse the contry code and then actually take them to country.aspx?code=GB. Is there anything in mojo I can hook into to do this or does anyone have ideas on how this could be done.

I'd appreciate any help possible - Thanks

11/11/2009 9:31:42 AM
Gravatar
Total Posts 18439

Re: Parsing dynamic url's that don't exist and redirect to actual url

There is a friendly url subsystem used by the CMS, really all CMS pages are served by /Default.aspx?pageid=x and friendly urls are mapped to the appropriate real url by our url re-writer.

I'm not sure about any easy way to hook in your parsing logic, but you could manually create friendly urls in Administration > Advanced Tools > Url Manager

You could create a friendly url country_GB.aspx and map it to a real url /country.aspx?code=GB

and so on for other countries.

A more complex solution that would allow parsing logic would be to implement a custom httphandler and then map it to handle all requests like country*.ashx from the Web.config handlers section, then in your handler you can do whatever parsing and redirect logic you like. Also you ca implement this handler a custom class library project so it lives in its own dll separate from mojoportal code.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.