sitecoresitecore7sitecore-dms

Using the/?sc_item={guid} URL and error 404's


a quick question on SC7.5 - We have a large legacy system that will be directing users to sitecore content. We know the GUID and want to redirect the user seamlessly via the URL www.mysite.com/?sc_item={guid}

We also want to be able to check if the content is still there and if not produce an error 404 which will allow us (and others) to clean up our links via 404 reports.

Is there a solution for this at all ?


Solution

  • One approach you might consider is using a reverse proxy. You can install the Application Request Routing module on IIS. This will allow you to inspect and rewrite incoming requests to the ARR site and forward them on to one or more backend servers. You can also rewrite the responses from those backend servers (adjust relative links on the page, fix the Response Location in the header, etc.)

    I've implemented a solution like this for a client that has a large legacy website and is incrementally transitioning content to Sitecore. The reverse proxy allows me to mask that from end-users. URLs remain the same as always.

    What really makes this technique powerful is that you can write your own rewrite provider for ARR. This means during the runtime of ARR you can execute arbitrary code rather than just rely on rules to achieve a desired effect. My rewrite provider actually communicates with Sitecore to determine what to do with the incoming request and then routes it accordingly.

    I wrote a blog post that covers this idea a little more explicitly: http://sitecoreblog.patrickperrone.com/2015/05/create-reverse-proxy-controlled-by.html