Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: ocean10000

IIS and httpd.ini

IIS using httpd.ini to handle multiple domains on server

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

5+ Year Member



Hi,

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:

[ISAPI_Rewrite]

### 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
RewriteCond METHOD POST
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
dev.example.com/test
redirects to
dev.example.com/test/


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

Root Domain WITHOUT trailing slash
dev.example.com
does NOT redirect to
dev.example.com/


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

Root Domain WITH trailing slash
dev.example.com/
redirects to
dev.example.com


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:

/example.com/


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.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month