API
Version 7.x > API > redirection from old site urls View modes: 
User avatar
Member
Member
Yehuda - 1/15/2014 4:44:29 AM
   
redirection from old site urls
Hi,

I'm starting a new project in which I need to move the site from an old CMS to Kentico.
For the project, I need to move the data to Kentico, but still allow the old URLs to point to the correct documents.
The old site is using a query string like ?id=412915&sNewsID=28511
to get the correct page.

Is there a place I can plug to the URL processing in Kentico and make redirects from the query string parameters to the new document?

Thanks

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/15/2014 7:04:07 AM
   
RE:redirection from old site urls
Kentico has URL aliases for documents. For instance your old url is /About/News/April/2013/news1.aspx

You can add that URL alias to your new page (/About-Us/News/Some-Descriptive-News-Title.aspx) and your old URL will automatically display the new page.

You can also set it up to permanently redirect to the new URL in the Site Manager>Settings area for the site or locally for each document in the Properties>URLs page.

As far as the querystring parameters, you should be able to enter those as well with your URL. The alias is simply looking for a pattern.

User avatar
Member
Member
Yehuda - 1/15/2014 9:06:05 AM
   
RE:redirection from old site urls
This won't help in my case.
All the urls in the old site are like this: /Dev2Go.web?id=458498&sSTID=289
Nothing else.
So for example the URL Dev2Go.web?id=458498&sSTID=289 would go to /News/NewsItem1,
but Dev2Go.web?id=458499&sSTID=289 would go to /Companies/Company1

I need to run some logic, maybe even to access the old database tables in order to figure which page they should go to.
If it's not possible, I guess I can insert a new alias path according to my logic.

User avatar
Member
Member
kentico_sandroj - 1/15/2014 1:40:13 PM
   
RE:redirection from old site urls
Hello,

Since you need to run custom logic to convert the querystrings to aliases, the best approach may be to add the custom code to the BeginReqest event in CMSAppBase. You would convert the querystrings as needed then use 301 to redirect. Would this approach work for you?

Best Regards,
Sandro

User avatar
Member
Member
Yehuda - 1/16/2014 12:42:32 AM
   
RE:redirection from old site urls
Thanks, In the end I used http://urlrewriter.net/, and implemented my own login to redirect to the correct NodeAliasPath.