How to Setup a Friendly URL
Applies To
- Behind the Firewall Installations (not recommended for UniversitySite Cloud)
Intended Audience
- System administrators
Background
Many of our customers like to use a short, easy to remember and easy to type URL for accessing UniversitySite e.g. iLearn. In order to use this friendly URL, all the end user has to do is type ilearn in their browser address bar and hit enter.
To set this up you will need to redirect your friendly URL to the UniversitySite website and creating a cname alias in your internal DNS to point to the web server where UniversitySite is installed.
Note
We do NOT recommend you setup a friendly URL if you are using us to host UniversitySite in the cloud because this breaks access to UniversitySite for most mobile users.
Steps
- Access DNS and create a cname alias for your new URL e.g. ilearn that points to the web server where you have UniversitySite installed
- Copy the code below and paste it into a notepad window on the UniversitySite web server
- Edit case "ilearn" to reflect your own chosen friendly URL
- Save this file as default.aspx at c:\inetpub\wwwroot, or d:\inetpub\wwwroot if you installed IIS on d:\.
<%@ Page Language="C#" %> <% string hostName = Request.ServerVariables["HTTP_HOST"].ToLower(); switch (hostName) { case "ilearn": // use lowercase (ilearn vs iLearn) // redirect http://iLearn to UniversitySite Response.Redirect("/UniversitySite"); break; default: // alternatively redirect all requests to UniversitySite Response.Redirect("/UniversitySite"); break; } %> <html> <head><title>ReDirector</title></head> <body> redirector </body> </html>
Testing
- Open a cmd prompt and ping ilearn to ensure you are getting the correct response
- You may have to do an ipconfig /flushdns if you moved the web server
- Open a browser and type nothing but "ilearn" (insert your friendly url here) and hit Enter