Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

IIS and httpd.ini

IIS using httpd.ini to handle multiple domains on server

4:27 am on Mar 15, 2012 (gmt 0)

New User

5+ Year Member

joined:Dec 16, 2008
posts: 20
votes: 0


I am using the following for my shared hosting:

Platform Type: Windows 2003 Server Enterprise
IIS Version: 6.0
PHP Version: 5.2.5

The resource has a httpd.ini file located in the root directory. I have multiple domains and each domain has the following rules:


### subdomain redirect v2 ###
RewriteCond Host: (?:.+\.)?dev\.example\.com
RewriteCond URL ^/example.com/(.*)
RewriteCond METHOD GET
RewriteRule ^/example.com/(.*) /$1 [I,R]
RewriteCond Host: (?:.+\.)?dev\.example\.com
RewriteRule ^/example.com/(.*) /$1 [I]
RewriteCond Host: (?:.+\.)?dev\.example\.com
RewriteRule (.*) /example.com/$1 [I,L]

I am trying to understand why all requests to a subfolder always perform a 302 redirect, appending a trailing slash.

Subdirectory WITHOUT trailing slash
redirects to

When I navigate to the domain itself, it does not append a trailing slash:

Root Domain WITHOUT trailing slash
does NOT redirect to

Instead the trailing slash is REMOVED when navigating to the domain with the trailing slash appended:

Root Domain WITH trailing slash
redirects to

When I observe the headers I see the following:

HTTP/1.1 302 Object moved
Server: Microsoft-IIS/6.0

My resource is located within my hosting account at the following path from the root:


My main questions are as follows:

1) Could someone explain the ISAPI Rewrite rule above in simple terms?

2) Is the above ISAPI rule responsible for appending/removing the trailing slash as outlined above?

3) I have hosted in multiple environments, but the above behaviour appears isolated to the server environment I am currently hosted on. Is there any way I can prevent the trailing slash from being appended?

Please note the purpose is to ensure no redirects occur when I request a resource that does not end in a trailing slash for SEO.

Thanks in advance.