Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Programmatically handle "Simple addresses"

Vote:
 
I'd like to programmatically handle "Simple addresses" for pages. Is this in some way possible to do? The problem is that we have a client that want's http://domain/shortcut1 to be directed to http://domain/page____1.aspx?key=shortcut1 http://domain/shortcut2 to be directed to http://domain/page____1.aspx?key=shortcut2 etc. I thought of writing my own httpmodule to handle this but I haven't found a way to do it without modifying the isapi-filters or using a custom 404.
#12522
Feb 16, 2006 20:33
Vote:
 
I see two answers in this question: 1. You want to supply the simple address over to the query string in the final address. To do this, use RewritePath (look for this in your MSDN Library or on Google. I think it's in the HttpContext class.) 2. You want to enable several simple addresses to one page in EPiServer. To do this, simply create two pages somewhere in a hidden place on you site, set each of these pages' simple address to Shortcut1 and Shortcut2, and under Shortcut/External, set its actual URL with the querystring and all.. Hope this helps. Frank :)
#14420
Feb 17, 2006 14:25
Vote:
 
Thanks for the reply. I would like to go with your first alternative. Since there are more than a hundred shortcuts to be made, and I'd prefere not to make one epi-page for each. The problem I have with rewrite path, which I have researched a little bit is that I can't trap the request for a directory that doesn't exist. This "http://domain/page.aspx" will run through .NET but this "http://domain/something" will not. And the only ways I've seen this done is either by adding all extensions and pages without extensions to the .net-isapi-filter in IIS OR creating your own 404-page which will handle these call. I'd like to do something smoother ;)
#14421
Feb 17, 2006 15:56
Vote:
 
You're in trouble, but it can be done :-) Go with the 404 alternative, but you also have to add exception handling to catch asp.net resource not found exceptions. /Steve
#14422
Feb 17, 2006 16:06
Vote:
 
Ok, I'll dig into the 404 then. You mind me asking how you've done it? ;)
#14423
Feb 17, 2006 18:46
Vote:
 
I could tell you, but then I'd have to ...... :-) My solution is a Custom 404, a HttpModule and lots of code! It has the following features: * A custom 404 FileNotFound page to replace the built-in error page - with YOUR design * A powerful CustomRedirects module thats extends the built-in ShortCutUrl function, specified in an xml file: /templates/page.aspx?id=1234 /travel /mytemplates/form.aspx?id=3453 http://www2.mysite.no/page13241.php /extra/ecp /extra/eec /templates/ecb.aspx?id=7556 /wehavemoved /oldshortcuturl /newshortcuturl /demo1/notfoundtest /demo1/notfoundtest /demo1/templates/Page.aspx?id=7411111 ~/search It handles missing ASP.NET resources (.aspx) files, and even EPiServer pages that have been deleted (the url is still valid, but the ID is not. This one treats it as a 404!) * It also has an admin plugin that shows all the CustomRedirects defined * FallBack url handling that allows all 404 requests to be redirected to a back-end server only if the url exists on that server. Great when you replace some old (competitor wcm) system. Just give it another host-name (www2 or something) and the handler will redirect the request to the old server, but only if the url exist on that server. If not - you will be redirected to your new fancy 404 page. Oh, did I mention that it will be free for all EPiServer developers, with source code? End of this month, or early March. /Steve
#14424
Feb 17, 2006 21:03
Vote:
 
That does sound like a lot of work. But if your's gonna be released early march I'll just hang around ;) Sounds great!
#14425
Feb 20, 2006 22:21
Vote:
 
Have you released it yet :) ? Gustaf.
#14426
Jul 26, 2007 15:53
Vote:
 
It is Gustaf. @ EPiCode https://www.coderesort.com/p/epicode Regards HAXEN
#14427
Jul 27, 2007 15:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.