0

I need to create a vanity url for the following link: http://www.cvent.com/d/2cq542

Needs to be something like: http://www.opportunityfinance.com/SmallandEmerging/

The biggest problem I see is that there is NO apache support. Only ASP.net, which I'm still trying to come to grasps with.

Can someone either point me in the right direction or help get me started with something? Thinking I would need to create a .aspx or .asp file and call Request.ServerVariables or something somehow.

Thanks guys!

Solomon Closson
  • 6,111
  • 14
  • 73
  • 115
  • 1
    Are you creating a new site, or modifying an existing site? If new consider using MVC which tends to use those SEO friendly URL styles. You could also use URL rewriting in ASP.NET to accomplish that. – JohnFx Apr 04 '13 at 14:56
  • How to use URL rewriting in ASP.net? Confused with this. I have access to the database and the files. What do I do exactly? – Solomon Closson Apr 04 '13 at 15:29
  • Do some research first and ask a specific question! @JohnFx, webforms can use as clean urls as mvc without any problem, without any extra work... – walther Apr 04 '13 at 15:38
  • I do not fully understand you. Do you wish to still see the old url, or to get from the old and move to the new ? – Aristos Apr 04 '13 at 16:17
  • @Aristos - Actually, a redirect would work also... – Solomon Closson Apr 04 '13 at 16:23
  • @Aristos - whichever is easier is fine by me. – Solomon Closson Apr 04 '13 at 16:29

1 Answers1

0

If you look for redirect, then you have two ways.

Either you have each page alone and simple make the redirect, either programmatically on global.asax by checking where you are and where you wish to go, an example:

protected void Application_BeginRequest(Object sender, EventArgs e) 
{       
    // get here the map from /d/2cq542 to /SmallandEmerging/
    // return null for no map
    string cWhereToGo = GetTheRedirectMap(HttpContext.Current.Request.Path);

    if(cWhereToGo != null)
    {
        // you can also add different domain on the start.
        HttpContext.Current.Response.Redirect(cWhereToGo, true);
        HttpContext.Current.Response.End();
    }
}
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • Thanks, I'll try and find global.aspx file now. But do I need to invoke this function, or will this function be invoked automatically when typing in the `/SmallandEmerging` url – Solomon Closson Apr 04 '13 at 16:46