Monthly Archives: December 2011

Interviews with Jordanian Microsoft Guests

During the last quarter of 2011 we have hosted two amazing Jordanian Microsoft guests, Yousef Al Khalidi (Distinguished Engineer), and Ayman Dahleh (Development Manager for the Global Experience Platform group), who happened to be having their vacation here, they generously accepted our invitation to deliver sessions here in Jordan despite their busy times.

The community recorded these two inspiring interviews with our guests through which I can see how close achievements can be.

A big thank-you to Mr. Yousef and Mr. Ayman for their availability, and thanks to our DPE at the time Mohammad Arrabi for giving us this opportunity to meet such great people, and thanks to our community member Mosab for making these videos.

Hide Subfolder in Multiple Domains Under One Site

After I have moved to WinHost, I was surprised they don’t support multiple domains under one site out of the box; you have to rely on IIS URL Rewrite magic to achieve that.

So as expected, I looked for a solution in their KB and the internet (you don’t reinvent the wheel, remember?) and found couple of posts here, here, here, and here that helped a lot in achieving this.
So I managed to have www.emadashi.com and www.dotnetarabi.com working fine together residing in the folders “emadashi-blog” and “dotnetarabi-root” respectively under the root; they both have same IP address, but upon request a redirection is made to the proper application folder.

Until one day my very good friend Omar Qadan generously shared a link to an episode he found interesting; and the link was as the following:

“www.dotnetarabi.com/dotnetarabi-root/episode.aspx?..etc”

Ops! that’s not right isn’t it! The URL should not include the folder name “dotnetarabi-root”! So I read more about Regular Expressions, read the above mentioned article more thoroughly, and came to the conclusion that for each domain we have we are going to write two rules:

1) Correct and Redirect undesired URL’s:
If IIS receives a request that contains the folder name (e.g “www.dotnetarabi.com/dotnetarabi-root/episode.aspx”), then:

  1. Omit the folder name from the URL, in our case the URL becomes “www.dotnetarabi.com/episode.aspx” 
  2. Redirect the request again to IIS using the new URL, by sending 301 status prompting the browser to initiate a new request with the new URL

The step above can be achieved by the following:

Figure 1:

    1. <rule name="UnWantedDirectAccessToSubFolder-DotNetArabi-root" patternSyntax="ECMAScript" stopProcessing="true">
    2. <match url=".*" />
    3. <action type="Redirect" url="{C:1}" appendQueryString="true" logRewrittenUrl="false" />
    4. <conditions>
    5. <add input="{HTTP_HOST}" pattern="^(www.)?dotnetarabi.com" />
    6. <add input="{PATH_INFO}" pattern="^[/\\]dotnetarabi_root[/\\](.*)" />
    7. </conditions>
    8. </rule>

Then we do the second rule:

2) Guide and Redirect desired URL’s to the right folder:
If IIS receives a request by the URL format we desire, which doesn’t contain the folder name (e.g. “www.dotnetarabi.com/episode.aspx”) then:

  1. Insert the folder name to the URL to be come “www.dotnetarabi.com/dotnetarabi-root/episode.aspx” in our case
  2. Rewrite the URL again within IIS using the new URL

Which can be achieved by the following:

Figure 2:

    1. <rule name="DirectToDotNetArabiRoot" patternSyntax="ECMAScript" stopProcessing="true">
    2. <match url=".*" />
    3. <action type="Rewrite" url="dotnetarabi_root/{R:0}" appendQueryString="true" logRewrittenUrl="false" />
    4. <conditions>
    5. <add input="{HTTP_HOST}" pattern="^(www.)?dotnetarabi.com" />
    6. <add input="{PATH_INFO}" pattern="^[/\\]emadalashi_blog[/\\]" negate="true" />
    7. <add input="{PATH_INFO}" pattern="^[/\\]dotnetarabi_root[/\\]" negate="true" />
    8. </conditions>
    9. </rule>

The best way to describe what happens is through this diagram I put together (the start block is the “Browser”):

clip_image001

And that was it, now notice the following:

  1. The rules should maintain the mentioned order
  2. Rule 1 uses action type “Redirect”, and Rule 2 uses action type “Rewrite
  3. We configure the rules to stop processing any rule after it is executed
  4. Your key to successful and easy manipulation of the URL is to understand the Back-references in the URL Rewriting, notice the {C:1} and {R:0} usage above, notice as well the brackets () in the URL’s; they are used to capture the back-references, check the “Using back-references in rewrite rules” in the above mentioned article
  5. To test your rules use Fiddler, IE Developers Tools (Network tab), or Firebug (Net tab), and the great tool IIS provides to test rules which can be accessed by: open IIS –> select site-> URL Rewrite –> Double click rule –> double click condition –> Test pattern:
    clip_image002

I hope you found this useful.

Let me do thanks here to  www.gliffy.com as well for providing such great service for drawing diagrams online

Microsoft’s Support

microsoft-logoCouple of days ago I tried a key I acquired from Microsoft MSDN subscription to activate an Office installation, the activation didn’t work for some reason, so I filed a ticket, and I thought to myself “Oh great! now I will have to wait for ages until such large corporate like Microsoft would answer my ticket!”

And less than 48 hours, I don’t receive an email, but my phone rings! The guy on the phone answers my inquiry and makes sure I am answered.
Considering how large this corporate is and the number of its clients, this is really amazing!

So if you are a startup, or a growing business, please keep this in mind; don’t give excuses to yourself for a low quality of service due to your growing business.

Good job on this Microsoft.

“AmmanTT: Developer Edition” presentation and slides

It was a very interesting event “AmmanTT: Developer Edition” which took place last Tuesday; the team did a very good job putting it together, it is really great seeing this great effort put into such fruitful events; moving the community steps forward, so thank you AmmanTT team, you rock.

Hereby I post the slides I presented in my talk:

Speaking at AmmanTT: Developer Edition

AmmanTTI will be speaking at “AmmanTT: Developer Edition” next Tuesday 6th of December 2011. Never heard about AmmanTT? quoting from their About page:

Coming to you on the first Tuesday of every month is a 2-hour event that brings industry experts, local technologists/engineers, entrepreneurs, idea-generators and just about any enthusiast together in a casual setting to meet and learn from each other

I will be talking about the real-life side of the software development life cycle, and about the overlapping between Process and Humans in the cycle. So mark your calendars, I will be very happy to meet you there.