Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Multiple Document Aliases Not Redirecting to Primary Alias... View modes: 
User avatar
Member
Member
jonnycombs - 3/18/2009 3:45:48 PM
   
Multiple Document Aliases Not Redirecting to Primary Alias...
I recently migrated my site from php to asp.net running Kentico. This meant that I needed to create document aliases that mapped all of the old pages to the new pages. Is there some way to cause a redirect from the old page to the new page, instead of making it appear as though the old link should still be used. For example, if I used to have a page at /customercare/index.php and it now is located at /Customer-Care.aspx, I would create an alias in Kentico of /customercare/index.php. Then when somebody visits /customercare/index.php they would be redirected to /Customer-Care.aspx. If they are not redirect, search engines will see this as two separate pages with identical content. Any help with this would be appreciated.

User avatar
Member
Member
richard.pendergast-notatallstrange - 3/18/2009 11:35:05 PM
   
RE:Multiple Document Aliases Not Redirecting to Primary Alias...
Not sure if it helps, but we ran into this a couple of months back, prior to Kentico 4.0.

Our solution at that point was to use a 3rd party product - HeliconTech ISAPI Rewrite. Using this we are not only able to put in place redirects for historical content, but are also able to specify the type of redirect. By putting in place a 301 (permanent redirect) users search engines are informed of a permanent change to the URL.

User avatar
Member
Member
jonnycombs - 3/19/2009 8:27:02 AM
   
RE:Multiple Document Aliases Not Redirecting to Primary Alias...
Thanks for the response. Currently I have a large amount of code that is locking me into using Kentico for all of my aliasing, but if can't find a Kentico solution I may need to look at this.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/19/2009 5:29:18 AM
   
RE:Multiple Document Aliases Not Redirecting to Primary Alias...
Hello,

If you use version 4.0 you could eventually add old path with .php extension as alias for document in 'Properties -> URLs' section. In this case you would also need to have .php extension set to be processed by .NET famework in IIS.

Best Regards,

Martin Dobsicek.

User avatar
Member
Member
jonnycombs - 3/19/2009 8:22:54 AM
   
RE:Multiple Document Aliases Not Redirecting to Primary Alias...
This is actually where I'm running into the problem. I am using version 4.0, and I have added the old path in Properties->URLs as an additional document alias. The issue is that when people go to /customercare/index.php, it doesn't redirect them to the new page with a 301 redirect, instead it sends a status 200, implying that /customercare/index.php should continue to be used. Is there any way to have all additional document urls redirect to the original document url?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/20/2009 8:18:37 AM
   
RE:Multiple Document Aliases Not Redirecting to Primary Alias...
Hello,

You could put custom code to ensure this into Application_BeginRequest method in ~\App_Code\Global.asax.cs file. You can check current URL and eventually use sample code bellow to ensure 301 redirection:

Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","targetURL");


Best Regards,

Martin Dobsicek