homepage Welcome to WebmasterWorld Guest from 54.205.106.111
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
IIS and httpd.ini
IIS using httpd.ini to handle multiple domains on server
mdsww




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

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.

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved