Alpha Software Blog



IIS Server Tutorials: Using URL Rewrite to Fix URLs in IIS


The Alpha Anywhere Application Server for IIS is currently in beta. In this first post in a series of IIS server tutorials, lead architect Terry Smith answers questions from beta testers. For more information on the Alpha Anywhere Application Server for IIS, check out this overview webinar on-demand.

--------------------------------

Alpha Anywhere LogoA developer recently asked, “Is there a way to hide page extensions in URLs when running under the Alpha Anywhere Application Server for IIS? For instance, the end user types https://www.mydomain.com/mypage and the mypage.a5w page is processed and returned.”

The answer is “Yes”. It can be done using an IIS component called URL Rewrite. The IIS component ecosystem is one of the benefits of using IIS.

URL rewriting is a very useful feature for doing tasks like making public URLs prettier (e.g. not including file extensions) or for doing something more advanced like making sure old bookmarked URLs still work when a backend completely changes. In the latter case someone may have bookmarked http://www.mydomain.com/1999app/cgi-bin/help.exe?topic=contents but the new system needs the URL to look like this https://www.mydomain.com/help2014/contents. This example is contrived, but does happen in practice and demonstrates what can be done with URL rewriting.

To answer the “hide page extensions” question, after installing the URL Rewrite component you can define a rewrite rule to add a .a5w extension to a URL’s path when an extension doesn’t exist. IIS will examine the URL for each request that comes in for the site and if it matches the rule pattern will rewrite the URL so continued processing in IIS will see the rewritten URL instead. By the time the URL makes it to the Alpha Anywhere Application Server for IIS it will have the .a5w extension.

There are also outbound rules that you can use too. You would use an outbound rule to strip off the .a5w extension on links. This takes time though as the entire response body needs to be processed. It might be better to make your links not have .a5w extensions to begin with.

One caveat is that right now working preview and live preview in Alpha Anywhere Developer Edition do not use IIS so testing a web app without .a5w extensions would have to be done to a  published web application on an IIS server.

To install the URL Rewrite extension, select the server node in IIS Manager, click on the Get New Web Platform Components link and then search for URL Rewrite.


Alpha Software


Once it is installed you will most likely need to close IIS Manager and then restart it to see the URL Rewrite icon.

Alpha Software


IIS server tutorials
IDC 2015 Predictions for Enterprise Mobile Application Development and Solutions
Demo - Integration between Alpha Anywhere 3.1 and the DHTMLX calendar

About Author

Terry Smith
Terry Smith

Lead IIS Engineer at Alpha Software

Related Posts
Setting Up App Security Just Got Easier
Setting Up App Security Just Got Easier
Alpha Anywhere
Alpha Anywhere "Developer2Developer" Interview Series: Alex Collier
Alpha Software Helps Evolytix Achieve  Up to 75% Productivity Boost
Alpha Software Helps Evolytix Achieve  Up to 75% Productivity Boost

The Alpha platform is the only unified mobile and web app development and deployment environment with distinct “no-code” and “low-code” components. Using the Alpha TransForm no-code product, business users and developers can take full advantage of all the capabilities of the smartphone to turn any form into a mobile app in minutes, and power users can add advanced app functionality with Alpha TransForm's built-in programming language. IT developers can use the Alpha Anywhere low-code environment to develop complex web or mobile business apps from scratch, integrate data with existing systems of record and workflows (including data collected via Alpha TransForm), and add additional security or authentication requirements to protect corporate data.

Comment