BharatBhasha.com
 
Free Articles  >>  Technology >>  Page 7  >> 

ISAPI Rewrite

ISAPI Rewrite    by Pam Dean

Have you ever wanted to manage multiple domain names under a single account in IIS (Internet Information Services)? A common way to do this is to handle it from code. There are some disadvantages when handling this directly from code. Static pages aren't redirected, non-developers will need to purchase or dust off their programming books, and evidence remains that a redirection was done.

Along came ISAPI Rewrite www.isapirewrite.com to solve this issue. Running at the ISAPI level in IIS, this is done before any page or code is accessed so it works equally well on static and dynamic content. It overcomes all the objections mentioned above.

With common redirection code, the user would see something like this:
http://www.domain1.com
http://www.domain2.com/domain2
http://www.domain3.com/domain3

With the ISAPI Rewrite component, the user will see this:
http://www.domain1.com
http://www.domain2.com
http://www.domain3.com

Even though behind the scenes the sites can be in completely different sub-folders, the person visiting the website won't have any concept of this. They will simply see the clean domain names.

ISAPI Rewrite will rewrite (kind of like a redirect) the user to a sub-folder even though the web browser doesn't realize this.

This is done very fast and efficiently and managed by a file called httpd.ini which should be placed in the root of the site. It controls which domain names are handled by which sub-folder by utilizing different regular expression rules.

Some tips to remember when creating the rules.

# is used to comment out a line

The following characters must be preceded by a "" to be recognized as a literal character ( meaning a character that represents itself)

".", "*", "?", "+", "(", ")", "{", "}", "[", "]", "^" and "$".
This becomes important when typing (www.domain.com) it would have to look like (www.domain.com)

Parentheses are used to group items together to be marked as what is to be matched, such as "(apple)*" would match all of the string "appleappleapple".

You can see more helpful expression tips here, http://www.isapirewrite.com/docs/examples

Some examples of the rules you will see in the httpd.ini file look like this:

#manual redirect of one domain
RewriteCond Host: (www.)?domain1.com
RewriteRule (.*) /domain1$2

#redirecting to another URL
RewriteCond Host: (www.)?domain1.com
RewriteRule (.+) http://www.domain2.com$1 [R]

#Rewrite just one domain but keep the old link working
RewriteCond Host: (www.)?domain1.com
RewriteRule (?!/domain1)(.*) /domain1$2 [I]

Many tricks come with a catch, and this is no exception. One disadvantage that I have come across is that the response.write from ASP or ASP.NET does not work well in conjunction with this component. Absolute paths are required since relative paths are done after ISAPI Rewrite handles the request and aren't redirected as would be expected. The workaround is to use absolute paths with the full domain name in the redirect. If Server.Transfer is to be used, it should be tested as well. It runs into similar issues.

Additionally, when using ASP or ASP.NET, the new virtual root folder should be marked as an application so that the new virtual root's folder is used for global.asa(x), web.config and /bin.



Article Source: http://www.BharatBhasha.com
Article Url: http://www.bharatbhasha.com/technology.php/23303

Articles In LimeLight
  • Win Social Security Disability For Bipolar: How To Build A Bullet Proof Case
    By Sarah Freeman Added on Friday, May 16, 2008
  • Can A Blog Actually Make Money?
    By Brian Garvin Added on Saturday, May 17, 2008
  • Drug Rehab – It’s A Hard Road But You Don’t Have To Do It Alone
    By Mary Waltrip Added on Thursday, May 15, 2008
  • What Is Online Trading In Forex?
    By John J Callingham Added on Saturday, May 17, 2008
  • Replace Negative Thinking With Positive Thinking
    By Ronnie Nijmeh Added on Wednesday, May 14, 2008
  • The Path To Sainthood
    By Elizabeth Guide Added on Friday, May 16, 2008
  • Personal Injury Compensation Accident Claims
    By Carolyn Clayton Added on Friday, May 16, 2008
  • Single Table And Super Satellites Buy-in
    By Michael Binns Added on Saturday, May 17, 2008
  • How Do You Get Paid When You Make Money Online?
    By Troy Shanks Added on Saturday, May 17, 2008
  • Seven Gifts Of The Holy Spirit
    By Elizabeth Guide Added on Friday, May 16, 2008
  • General Instructions For Diabetics
    By Safron Jeen Added on Monday, April 21, 2008
  • The New Reality Of Energy
    By Julie Redstone Added on Thursday, May 15, 2008
  • Payday Loans And Cash Advances Are The Oldest And Most Reliable Short Term Cash Solution
    By Kurt Maschoff Added on Saturday, May 17, 2008
  • Car Hire Hamburg Airport – A Great Way To Travel Germany
    By Lakshmi Reddy Added on Thursday, May 15, 2008
  • The Paleozoic Era
    By Claudia Mann Added on Thursday, May 15, 2008
  • Bold & Sassy Chef Aprons
    By Max Johnson Added on Wednesday, May 14, 2008
  • Problems and Crisis
    By Jose Riesco Added on Wednesday, April 30, 2008
  • Internet And Business Online – A Tale Of Cause And Effect
    By Scott Lindsay Added on Friday, May 16, 2008
  • How To Get A Great Deal On House Painting
    By IPRWire Staff Writer Added on Sunday, April 27, 2008
  • The Basics Of Html Tagging
    By Dave Text Added on Sunday, April 27, 2008
  • About Author Pam Dean :


    Pam Dean is Web Support Specialist with ORCS Web, Inc. - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.

    Publishers / Webmasters
    Tell A Friend
    Comments / Questions?
    Download this article in PDF
    Search through all the articles:


    343 Users Online!
    Top Read Articles:
    Latest Articles:
     
    Technology >> Top 50 Articles on Technology >> All Articles in this category
    Category - >
    • Advertising • Advice • Affiliate Programs • Automobiles
    • Be Your Own Mentor • Careers • Communication • Consumers
    • CopyWriting • Crime • Domain Names • DoT com Entrepreneur Corner
    • Ebooks • Ecommerce • Education • Email
    • Entertainment • Environment • Family • Finance And Business
    • Food & Drink • Gardening • Health & Fitness • Hobbies
    • Home Business • Home Improvement • Humour • House Holds
    • Internet And Computers • Kiddos and Teens • Legal Matters • Mail Order
    • Management • Marketing • Marriage • MetaPhysical
    • Motivational • MultiMedia • Multi Level Marketing • NewsLetters
    • Pets • Psychology • Religion • Parenting
    • Politics • Sales • Science • Search Engine Optimization
    • Site Promotion • Sports • Technology • Travel
    • Web Development • Web Hosting • WeightLoss • Women's Corner
    • Writing • Miscellaneous Articles • Real Estate • Arts And Crafts


    Disclaimer: The information presented and opinions expressed in the articles are those of the authors
    and do not necessarily represent the views of Bharatbhasha.com and/or its owners.


    Copyright © AwareINDIA. All rights reserved || Privacy Policy || Terms Of Use || Author Guidelines || Article Search
    FAQs Link To Us || Submit An Article || All Products || Free Downloads|| Contact Us || Site Map  || Advertise with Us ||
    Click here for Special webhosting packages for visitors of this website only!