SUMMARY
You can use the .Htaccess files to set individual properties and configuration settings for a folder. If you do so, you do not have to modify the full configuration file. You can configure some of these settings in Internet Information Services (IIS); however, you must use the main Internet Services Manager snap-in to change other settings. This article describes how to migrate .Htaccess settings to IIS.
back to the top
Limiting Access by IP Address
The .Htaccess file uses the Order, Allow, and Deny directives to limit access by Internet Protocol (IP) address or domain name.
To limit access according to IP address or domain name in IIS:
- Right-click the folder, the existing file, or the Web site, and then click Properties.
- Click either File Security or Directory Security.
- Click Edit in the IP Address and Domain Name restrictions section.
NOTE: In IIS (unlike Apache), an explicit Deny directive always applies, even if an Allow directive would typcially override it.
back to the top
Configuring Authentication Settings
To configure the authentication settings for a folder or a file, you must migrate the user and group information to the Windows 2000-based server.
To configure authentication settings:
- Right-click the folder, the existing file, or the Web site, and then click Properties.
- Click either File Security or Directory Security.
- Click Edit in the Anonymous access and authentication control section.
back to the top
Configuring Folder Settings
You can use the Options directive in Apache Directory directives and .Htaccess files to configure folder-specific settings. To grant the Execution permission for CGI on a folder in IIS, (CGI is equivalent to the ExecCGI option in Apache):
- Right-click the folder, and then click Properties.
- Click either the Home Directory tab or the Directory tab.
- Select the Execute permission for a script in the Execute Permissions section.
- To allow specific extensions to be run with specific programs, click Create to create a new program, and then click Configuration to edit the file name extension or program mappings.
To configure the folder so that users can browse the folder contents in IIS, (which is the equivalent to the Indexes option in Apache):
- Right-click the folder, and then click Properties.
- Click either the Home Directory tab or the Directory tab.
- Click to select the Directory Browsing check box.
back to the top
Configuring the Default Folder File
To change the list of default documents or their preference order in the same way that you do with the DirectoryIndex directive in an .Htaccess file:
- Right-click the folder, and then click Properties.
- Click the Documents tab.
- Click Add to add a new default document, or click Remove to delete an existing default file from the folder listing.
- Click an existing document, and then use the UP ARROW key and the DOWN ARROW key to change the priority of the item.
back to the top
Redirecting URLs
The .Htaccess file uses the Redirect directive to redirect a file or folder to another URL, for example:
Redirect /old_file.html
http://www.domain.com/new_folder/new_folder.html
You can either use Internet Services Manager to redirect a URL or you can create the Default.asp folder in the folder to which you want to redirect the URL.
To use Internet Services Manager:
- Right-click the folder, the existing file, or the Web site, and then click Properties.
- Click the Home Directory tab, the Directory tab, or the File tab, click A redirection to a URL, and then type the replacement URL in the Redirect to box.
For a user-defined solution, you can create a file called Default.asp in the folder in which you want to redirect the URL, and then use the Response.Redirect statement to redirect a request for a particular element, for example:
Response.Redirect /old_file.html
http://www.domain.com/new_folder/new_file.html
back to the top
REFERENCES
For additional information about how to redirect files and folders, click the article number below
to view the article in the Microsoft Knowledge Base:
324000 HOW TO: Redirect URLs to Alternative Web Sites
For additional information about limiting access to a folder by IP address or configuring authentication settings, click the article number below
to view the article in the Microsoft Knowledge Base:
324066 HOW TO: Restrict Site Access by IP Address or Domain Name
324222 HOW TO: Migrate User and Group Information
324068 HOW TO: Set IIS Permissions for Specific Objects
For additional information about securing IIS for migrating from UNIX to Windows, click the article number below
to view the article in the Microsoft Knowledge Base:
324216 HOW TO: Secure IIS in a UNIX-to-Windows Migration
back to the top