The web hosting publication by web hosting users for web hosting users
Update a Host / Editor Login
Search
Article News Host Business Name
DIRECTORY TOP RATING EDITOR REVIEW FORUM SEARCH HOSTING SHOWCASE BECOME AN EDITOR
RECENT NEWS
The Evolution of the IT Specialist
ICANN Decides To Expand Internet
Pingdom Adds Business Monitoring Plan
Apptix Offers Hosted VoIP Products
ARTICLES
Co-location Hosting
Dedicated Servers
Domain Names
E-Commerce / Merchant Accounts / Payment Gateways
Free Web Hosting
General Web Hosting
Hosting Software & Control Panels
Managed Web Hosting
Programming
Reseller Hosting
Running a Web Hosting Business
Search Engine Optimization
Specific Web Hosting Provider or Company
Technical & Security
Useful Website Tools
Virtual Private Servers
Web Design & Content
Website Marketing Campaign
SEARCH ARTICLES
WEBHOST DIRECTORY
By Location


By Category
Application Hosting
Collocation Hosting
Dedicated Servers
Domain Name Registration
Ecommerce Hosting
Free Web Hosting
Reseller Domain Name Registration
Reseller Hosting
Shared Web Hosting
Virtual Private Servers
By Function
Windows Web hosting
PHP Web Hosting
Mysql Web Hosting
ASP Web Hosting
MS SQL Server Web Hosting
Coldfusion Web Hosting
MS FrontPage Web Hosting
Ecommerce Web Hosting
Cheap/Discount Web Hosting
Personal Web Hosting
Domain Name Web Hosting
A-Z Listing
Enter web host domain:




Articles
  You are here : Home » Articles » Programming
ISAPI REWRITE
Submitted by Kelly Anderson on | 250 reads
How to manage multiple domain names under a single account in IIS (Internet Information Services)? 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 target=blank>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".

Many tricks come with a catch, and this is no exception. One disadvantage 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.





ARTICLES | NEWS | DIRECTORY | TOP REVIEWS| TOP RATINGS| FORUM | SEARCH | SHOWCASE | UPDATE A HOST
OUR EDITORS | CONTACT US | ADVERTISING | TERMS OF AGREEMENT
© Copyright 2006 , The Web Hosting Herald. All rights reserved.